zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: pipeline that cannot be interrupted
Date: Thu, 28 Apr 2022 17:24:36 -0700	[thread overview]
Message-ID: <CAH+w=7bD+Rp475pw6fOutiTDLk_Dgw0eqC6S3ELeoD+QiR3wFA@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7a9j_1b6n-5wvgkazNmXOG208U42nFmmV6Jmxckvo7Hdg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 197 bytes --]

On Wed, Apr 27, 2022 at 1:29 PM Bart Schaefer <schaefer@brasslantern.com> wrote:
>
> Naively, the following not-really-a-patch-yet fixes it, and all tests
> still pass.

Does this make more sense?

[-- Attachment #2: gleader.txt --]
[-- Type: text/plain, Size: 511 bytes --]

diff --git a/Src/jobs.c b/Src/jobs.c
index af0a1233d..85d4c4d1f 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -1476,7 +1476,10 @@ addproc(pid_t pid, char *text, int aux, struct timeval *bgtime,
 	 * set it for that, too.
 	 */
 	if (gleader != -1) {
-	    jobtab[thisjob].gleader = gleader;
+	    if (jobtab[thisjob].stat & STAT_CURSH)
+		jobtab[thisjob].gleader = gleader;
+	    else
+		jobtab[thisjob].gleader = pid;
 	    if (list_pipe_job_used != -1)
 		jobtab[list_pipe_job_used].gleader = gleader;
 	    /*

      reply	other threads:[~2022-04-29  0:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-26  0:36 Ctrl-\ while executing a pipeline made zsh quit Vincent Lefevre
2022-04-26  0:44 ` Vincent Lefevre
2022-04-26  1:24 ` Bart Schaefer
2022-04-26  3:00   ` Vincent Lefevre
2022-04-26  4:05     ` Bart Schaefer
2022-04-26  9:07       ` Vincent Lefevre
2022-04-26  9:18         ` pipeline that cannot be interrupted (was: Ctrl-\ while executing a pipeline made zsh quit) Vincent Lefevre
2022-04-26 10:07           ` pipeline that cannot be interrupted Vincent Lefevre
2022-04-27 20:07             ` Bart Schaefer
2022-04-27 20:29               ` Bart Schaefer
2022-04-29  0:24                 ` Bart Schaefer [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='CAH+w=7bD+Rp475pw6fOutiTDLk_Dgw0eqC6S3ELeoD+QiR3wFA@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    --subject='Re: pipeline that cannot be interrupted' \
    /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

Code repositories for project(s) associated with this 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).