zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: Zsh Hackers' List <zsh-workers@zsh.org>
Subject: Re: interrupt handling bug (again?)
Date: Mon, 10 Jul 2017 10:36:32 +0100	[thread overview]
Message-ID: <20170710103632.5b2ffa30@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <20170703160933.633e5e52@pwslap01u.europe.root.pri>

On Mon, 3 Jul 2017 16:09:33 +0100
Peter Stephenson <p.stephenson@samsung.com> wrote:
> Backgrounded shell code with subproceses:
> 
> On Sat, 24 Jun 2017 12:03:10 -0700
> Bart Schaefer <schaefer@brasslantern.com> 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


      reply	other threads:[~2017-07-10  9:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-06 19:08 Mikael Magnusson
2017-06-24 19:03 ` Bart Schaefer
2017-06-30 13:33   ` Peter Stephenson
2017-06-30 21:16     ` Peter Stephenson
2017-07-02 19:32       ` Peter Stephenson
2017-07-02 20:05         ` Bart Schaefer
2017-07-02 20:22           ` Peter Stephenson
2017-07-03 15:09   ` Peter Stephenson
2017-07-10  9:36     ` Peter Stephenson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170710103632.5b2ffa30@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).