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 c...@case.edu http://cnswww.cns.cwru.edu/~chet/
signature.asc
Description: OpenPGP digital signature