bug-diffutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-diffutils] bug#20062: bug#20062: bug#20062: bug#20062: bug#20062: [


From: Giuseppe Scrivano
Subject: [bug-diffutils] bug#20062: bug#20062: bug#20062: bug#20062: bug#20062: [PATCH] diff: add support for --color
Date: Sat, 12 Sep 2015 10:54:24 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Paul Eggert <address@hidden> writes:

> Eric Blake wrote:
>> It seems like the only safe way is to block
>> TSTP except for in places where you know that you do NOT have pending
>> data that would mess with the terminal, even if the cost of getting the
>> process to a point where it will actually stop in response to the user
>> request takes longer.
>
> That's one way to do it, yes.  In practice, though, it's easier (and
> probably faster) to do what GNU ls does, namely to have the the signal
> handler just set a volatile flag, and to periodically inspect the flag
> during normal computation in places where you can easily arrange for
> the terminal to be in a known state before acting on the signal.

in a previous version of the patch, I was blocking signals when diff
starts using colored output and re-enable them again once exiting from a
colored context, but it was rejected because it could block indefinitely
on long lines.  Would block signals between a set_*_color_context and
reset_color_context be enough or do we need more granularity (there are
many places where printf is used in the code)?

Thanks,
Giuseppe





reply via email to

[Prev in Thread] Current Thread [Next in Thread]