1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-01-01 05:16:05 +01:00

50922: fix additional cases of signals for current shell jobs on the right of a pipeline.

Backs out part of 188c5cd5 (workers/50874).  With this change, after a
new subshell is forked upon suspend of the right side of a pipeline, the
previous foreground subjob is resumed first and the new subshell remains
stopped until that job finishes.
This commit is contained in:
Bart Schaefer 2022-11-09 20:24:57 -08:00
parent d873ed6026
commit 61610ea4bd
3 changed files with 12 additions and 8 deletions

View file

@ -1,3 +1,9 @@
2022-11-09 Bart Schaefer <schaefer@zsh.org>
* 50922: Src/exec.c, Src/jobs.c: fix additional cases of signals
for current shell jobs on the right of a pipeline. Backs out
part of 50874.
2022-11-08 Bart Schaefer <schaefer@zsh.org>
* 50897: Src/exec.c, Src/loop.c: nonzero status of complex

View file

@ -1899,8 +1899,12 @@ execpline(Estate state, wordcode slcode, int how, int last1)
break;
}
}
else if (subsh && jn->stat & STAT_STOPPED)
thisjob = newjob;
else if (subsh && jn->stat & STAT_STOPPED) {
if (thisjob == newjob)
makerunning(jn);
else
thisjob = newjob;
}
else
break;
}

View file

@ -564,12 +564,6 @@ update_job(Job jn)
* when the job is finally deleted.
*/
jn->stat |= STAT_ATTACH;
/*
* If we're in shell jobs on the right side of a pipeline
* we should treat it like a job in the current shell.
*/
if (inforeground == 2)
inforeground = 1;
}
/* If we have `foo|while true; (( x++ )); done', and hit
* ^C, we have to stop the loop, too. */