Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #11536

Re: SIGINT handling

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: SIGINT handling
Date 2015-09-22 09:41 -0400
Message-ID <mailman.1590.1442929303.19560.bug-bash@gnu.org> (permalink)
References <20150918151439.GA16455@chaz.gmail.com> <20150919203628.GA27872@chaz.gmail.com> <20150921094807.GA6229@chaz.gmail.com> <56005BC4.1070906@case.edu> <20150921212403.GB12000@chaz.gmail.com>

Show all headers | View raw


On 9/21/15 5:24 PM, Stephane Chazelas wrote:
> 2015-09-21 15:34:28 -0400, Chet Ramey:
>> On 9/21/15 5:48 AM, Stephane Chazelas wrote:
>>
>>> I'm not sure I prefer that WCE approach over WUE. Wouldn't it be
>>> preferable that applications that intercept SIGINT/QUIT/TSTP for
>>> anything other than clean-up before exit/suspend implement job
>>> control themselves instead (like vi's :! should create a process
>>> group and make that the foreground process group of the
>>> terminal so pressing ^C in sh -c vi, :!sleep 10, only sends the
>>> SIGINT to sleep)?
>>
>> The classic example is emacs remapping the terminal intr key to ^G
>> and using SIGINT as its internal abort-command signal.
> [...]
> 
> AFAICT emacs starts a new process group (and makes it the
> foreground process group).

Maybe, if it's being run from an interactive shell or in a separate
X window.  On the other hand, run this script with `dash':

echo before
emacs -nw /tmp/qux
echo after

If you use ^G to abort an editing command in emacs, you won't see `after'
displayed and the script will exit with status 130, even though emacs
clearly doesn't die due to SIGINT.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: SIGINT handling Chet Ramey <chet.ramey@case.edu> - 2015-09-22 09:41 -0400

csiph-web