GNU bug report logs - #24232
ls --color cannot be interrupted by a signal

Previous Next

Package: coreutils;

Reported by: Kamil Dudka <kdudka <at> redhat.com>

Date: Mon, 15 Aug 2016 13:56:01 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 24232 <at> debbugs.gnu.org (full text, mbox):

From: Kamil Dudka <kdudka <at> redhat.com>
To: Pádraig Brady <P <at> draigbrady.com>
Cc: 24232 <at> debbugs.gnu.org
Subject: Re: bug#24232: ls --color cannot be interrupted by a signal
Date: Mon, 15 Aug 2016 17:52:38 +0200
On Monday, August 15, 2016 15:55:13 Pádraig Brady wrote:
> The signal catching functionality originated trying to restore terminal
> color:
> http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=v4.5.3-89-g854
> 9068
> 
> That was adjusted to only outputting reset chars once for multiple signals,
> http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=v5.2.1-357-geae
> 1b7f
> 
> and not outputting reset chars at arbitrary places as that messes up
> multi-byte chars:
> http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=v5.2.1-368-gad
> c30a8
> 
> Maybe we should just buffer internally at put_indicator
> (&color_indicator[C_LEFT]); and output only at put_indicator
> (&color_indicator[C_RIGHT]) or equivalent. That wouldn't introduce
> significant overhead I think.

Internal buffering is certainly doable.  I guess there is some gnulib module 
that already implements such a buffer?

However, what to do with signal handling then?  Drop the SA_RESTART flag and 
implement EINTR loop only for the fwrite() call that writes data with escape 
sequences to the terminal?

Kamil

> Pádraig




This bug report was last modified 8 years and 338 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.