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: Dr. Werner Fink
Subject: Re: The lastpipe shell option even with job control?
Date: Tue, 28 Mar 2017 17:06:05 +0200
User-agent: Mutt/1.6.2 (2016-07-01)

On Tue, Mar 28, 2017 at 10:17:54AM -0400, Chet Ramey wrote:
> 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.

AFAICR this is what ksh93 does in sh_exit() ... zsh seems to write out
something like `zsh: job can't be suspended' for builtins

Werner

-- 
  "Having a smoking section in a restaurant is like having
          a peeing section in a swimming pool." -- Edward Burr

Attachment: signature.asc
Description: PGP signature


reply via email to

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