Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: subshell into a new process group
- X-seq: zsh-workers 54519
- From: "Anthony Heading" <ajrh@xxxxxxxx>
- To: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- Cc: "Zsh hackers list" <zsh-workers@xxxxxxx>
- Subject: Re: PATCH: subshell into a new process group
- Date: Mon, 11 May 2026 12:06:49 +0900
- Archived-at: <https://zsh.org/workers/54519>
- Feedback-id: i6aa94791:Fastmail
- In-reply-to: <CAH+w=7YTMtY10GmrcPujdNDmNT-JmdDswgynxrw65v7ghbVTTg@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <c8058f0e-45c1-4c24-b607-70b64101b692@app.fastmail.com> <CAH+w=7ZujXuY1z9RV_L7CFzdqH7rBmZF+wBksWzBm16EAHGs-w@mail.gmail.com> <9aaad53b-da59-4e32-86a2-d496438cb05d@app.fastmail.com> <CAH+w=7YTMtY10GmrcPujdNDmNT-JmdDswgynxrw65v7ghbVTTg@mail.gmail.com>
On Sun, May 10, 2026, at 1:43 PM, Bart Schaefer wrote:
> I don't think it needs a new ESUB flag. I've tried several test cases
> and can't find any way in which the following results in materially
> different behavior (other than the intended). Anyone? With this, the
> process group has already been changed before "disown".
Is that not too big a change? Consider eg
setsid zsh -c '(sleep 1 && echo alive) & kill -- -$$'
I'd expect that to continue to kill everything, and was thinking
that the extra flag is needed if we want the subshell to survive
only if we use '&!' instead.
It's made confusing by the fact that ESUB_PGRP is a misnomer,
it's applied to every call path except one (very unusual) area
something to do with pipelines where the call omits the flag:
entersubsh(ESUB_ASYNC, NULL);
but immediately (after a long comment) does this manually anyway:
setpgrp(0L, mypgrp = getpid());
I think the idea is that ESUB_PGRP really indicates whether jobtable
bookkeeping is supposed to be reset, not whether we want a new
process group. The flags could be reworked to be more explanatory
(current ESUB_PGRP could be inverted to be eg ESUB_CONTINUATION and
passed only for the one special case, etc), but it would be a lot of
mechanical code churn.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author