Giuseppe Scrivano wrote:
unfortunately there is not a standard way to deal with it. Last
time I looked at it, grep was suffering from this issue (Ctrl-C in the
middle of a color sequence) would leave the terminal in a funny state.
That's a bug in grep, and I just now filed a bug report for it here:
http://bugs.gnu.org/21461
Admittedly it is a pain to handle signals correctly, but as long as we're adding
the feature to diff we should do it right. I suggest looking at how GNU 'ls'
does it; 'ls' is reasonably bullet-proof against the problem.