Path: csiph.com!xmission!news.glorb.com!usenet.stanford.edu!not-for-mail From: Stephane Chazelas Newsgroups: gnu.bash.bug Subject: Re: SIGINT handling Date: Mon, 21 Sep 2015 16:58:54 +0100 Lines: 45 Approved: bug-bash@gnu.org Message-ID: References: <20150918151439.GA16455@chaz.gmail.com> <20150919203628.GA27872@chaz.gmail.com> <20150921094807.GA6229@chaz.gmail.com> <20150921153536.GA91724@stack.nl> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: usenet.stanford.edu 1442851142 25029 208.118.235.17 (21 Sep 2015 15:59:02 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-bash To: Jilles Tjoelker Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=ejtR1IDr30llLcinAT0WCJ0vgptzwEJ6jIjZxVj0fHg=; b=V5VqUpAbkDyxFhYt/hlo5FeTp3Z/+YIBkv2+doHiEtwMzamSMo6P7VRH4bWp3aFqdO hL8BMgo6+BmQwT9gR5N9EdTOQPQalRuuEAk8B8vD8CHSrlJBvS7xlxp7Cd7Q/mZkVFnS 4qSjAW8vWdk/p3dJhHRgxc+TIWWhT6m2YsawGWunA2TFeD4vnHmRnbqnc/jWkoNWMnz7 RZ6oheZe1Pkf6xC4Qu+8JQK7jl05DKzoxlI758w2UDwoOLR5JbQioyBg/IbBsGbWeEn5 pGSeH5Oxf2WcrPOdOccfTiohDDxBifDixy8B0OdVWLurb43feTbZyx6M4MtmiwxxF0Hb 0BxQ== X-Received: by 10.181.8.72 with SMTP id di8mr14511923wid.62.1442851135886; Mon, 21 Sep 2015 08:58:55 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20150921153536.GA91724@stack.nl> User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22a X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:11524 2015-09-21 17:35:36 +0200, Jilles Tjoelker: [...] > > One could also argue, that to be consistent, SIGTSTP and SIGQUIT > > should be treated similarly (strangely enough > > http://www.cons.org/cracauer/sigint.html doesn't mention SIGTSTP). > > Agreed for SIGQUIT, but not for SIGTSTP. For SIGTSTP, either the shell > has job control enabled or it does not. If it does, SIGTSTP stops the > job and continues the shell; if it does not, SIGTSTP stops the whole job > including the shell. [...] Note sure what you mean, we may not be talking of the same thing. What I meant: In: sh -c '(trap "" INT; sleep 10); echo done' If you send ^C, nothing happens. In: sh -c '(trap "" TSTP; sleep 10); echo done' If you press ^Z, the "sh" is suspended, but "sleep" keeps running in background. One could argue they should be treated the same (that sh shouldn't suspend itself if the process it's currently waiting for has not been suspended, just like for ^C it should not die of SIGINT if the process it's currently waiting for has not died of SIGINT). You may be talking of: sh -mc 'sleep 10; echo "$?"' where SIGINT upon ^C, SIGTSTP upon ^Z is sent to sleep only (not sh). -- Stephane