Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: interrupt handling bug (again?)



On Mon, 3 Jul 2017 16:09:33 +0100
Peter Stephenson <p.stephenson@xxxxxxxxxxx> wrote:
> Backgrounded shell code with subproceses:
> 
> On Sat, 24 Jun 2017 12:03:10 -0700
> Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> > If you
> > instead disown before the foreground job is done, the job table entry
> > for the foreground job is deleted, so the parent never notices that
> > it has exited and never resumes the loop at all.
> 
> I agree with this.
> 
> However, I think we can do slightly better by delaying the disown to the
> point where we send SIGCONT to the superjob (the background copy of the
> shell process) after finding it has no associated processes in the
> current shell. At that point it will start its own processes, so we
> never need to interact with it again.

It's been going through my mind that we can also add STAT_NOPRINT to the
job at the first point to prevent it showing up in the job list in the
mean time.  But this might be too clever by half, causing confusion, for
example, if you exit the parent shell (a common reason for wanting to
disown a job) before it's had a chance to restart the superjob.  So I
don't think I'm going to do this.

pws



Messages sorted by: Reverse Date, Date, Thread, Author