Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Jobs unexpectedly disowned
- X-seq: zsh-workers 44635
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Jobs unexpectedly disowned
- Date: Thu, 01 Aug 2019 22:00:24 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ntlworld.com; s=meg.feb2017; t=1564693225; bh=xlbz+oo6pYCXtME2rgvMVt6wRzk34a5fWkKvnrhj06A=; h=Subject:From:To:Date:In-Reply-To:References; b=hoFiYdrFOBbAXhG1vAFxl2Ukm+XlCFKqO7hNBR/2X9FXDTEyIRIZMN3g0nijWVrF6 txprqxWMj5zKgPtgAGTmjl98m3M5JV8Q2n4buQyH3sXYmSGRaFYVOyMY9ogqw/fbWr 6X/yyXaEXqMq6OfEEz88o9ehCU0pkCayNhslMSLvVNCyNZ98FTYDTVNXnAtR0QISj/ 0nVvrkqPIEf/yEjP+MH6Mybbioplp9ZNSLy/FDMm5u6mDR2gm2Bss8VJTUwlwocSJz 2s5JMTqGtY4qH/FuQroH1/Xle3iIceiFwd/UX6PLcloEWzdWHiAkUiQ3YnvzHGD223 +8EjJncaGXXhw==
- In-reply-to: <1564583126.6561.15.camel@samsung.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CGME20190721062030epcas2p2326b1b0c1779aba66272cc90656e2a29@epcas2p2.samsung.com> <CAN=4vMp4pMM1JHKVYz9Wzr1N8qhwZ4auXGThFTkA-BFWHgvOyg@mail.gmail.com> <1564583126.6561.15.camel@samsung.com>
On Wed, 2019-07-31 at 14:25 +0000, Peter Stephenson wrote:
> On Sun, 2019-07-21 at 08:19 +0200, Roman Perepelitsa wrote:
> > I'm seeing weird behavior with jobs getting disowned and I'm not sure
> > whether it's intended.
> >
> > function f2() { sleep 1 &; true }
> > function g2() { f2; jobs; wait }
> >
> > echo g2; g2
> >
> > When ran from `zsh -df` I get this:
> >
> > g2
> > [2] 31061
>
> We're not seeing job information because STAT_NOPRINT is being or'ed into the
> job status by this code within execpline().
>
> if (list_pipe || (pline_level && !(how & Z_TIMED)))
> jn->stat |= STAT_NOPRINT;
>
> because pline_level is non-zero.
This might be good enough --- a job that's been backgrounded has
been told not to use the terminal and if it's semi-detached in
that fashion we probably want it to show up as job.
pws
diff --git a/Src/exec.c b/Src/exec.c
index 2acb2c0bc..e81053d67 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -1690,7 +1690,8 @@ execpline(Estate state, wordcode slcode, int how, int last1)
lastwj = thisjob = newjob;
- if (list_pipe || (pline_level && !(how & Z_TIMED)))
+ if (list_pipe || (pline_level && !(how & Z_TIMED) &&
+ !(jn->stat & STAT_NOSTTY)))
jn->stat |= STAT_NOPRINT;
if (nowait) {
Messages sorted by:
Reverse Date,
Date,
Thread,
Author