bug-bash
[Top][All Lists]
Advanced

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

Re: The lastpipe shell option even with job control?


From: Chet Ramey
Subject: Re: The lastpipe shell option even with job control?
Date: Tue, 28 Mar 2017 10:17:54 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

On 3/27/17 9:44 AM, Dr. Werner Fink wrote:
> Hi,
> 
> I'd like to ask if there is crucial reason, beside the correct foreground
> process group, not to allow the lastpipe shell option for an interactive
> bash? Maybe something like in the attachment could be an option?

Yes, there is. Once you decide you're going to allow lastpipe when job
control is enabled, you commit to handling ^Z and allowing the user to
suspend that pipeline. You have to do something with the foreground
shell at that point. An interactive shell is already ignoring SIGTSTP,
so you'll have to undo that, set a handler, figure out where you are,
and decide what to do.

Some other shells attempt to solve the problem by forking (from the
TSTP handler??) cleaning up all the state, juggling the jobs table and
process status, and letting the forked shell continue with the pipeline,
but that's really fragile and I've never been tempted to implement it.

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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