From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id f7305367 for ; Thu, 1 Aug 2019 21:01:20 +0000 (UTC) Received: (qmail 6814 invoked by alias); 1 Aug 2019 21:01:09 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 44635 Received: (qmail 29253 invoked by uid 1010); 1 Aug 2019 21:01:09 -0000 X-Qmail-Scanner-Diagnostics: from know-smtprelay-omc-9.server.virginmedia.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25524. spamassassin: 3.4.2. Clear:RC:0(80.0.253.73):SA:0(-2.0/5.0):. Processed in 3.866948 secs); 01 Aug 2019 21:01:09 -0000 X-Envelope-From: p.w.stephenson@ntlworld.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _smtprelay.virginmedia.com designates 80.0.253.73 as permitted sender) X-Originating-IP: [86.16.88.158] X-Authenticated-User: p.w.stephenson@ntlworld.com X-Spam: 0 X-Authority: v=2.3 cv=PcnReBpd c=1 sm=1 tr=0 a=MiHCjVqLJ44lE3bxSlffFQ==:117 a=MiHCjVqLJ44lE3bxSlffFQ==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=IkcTkHD0fZMA:10 a=NKUWgSS_y1XBDdacqQYA:9 a=QEXdDO2ut3YA:10 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== Message-ID: <70bf670bc77bbf78f36671ab09cc2a020499c8f5.camel@ntlworld.com> Subject: Re: Jobs unexpectedly disowned From: Peter Stephenson To: zsh-workers@zsh.org Date: Thu, 01 Aug 2019 22:00:24 +0100 In-Reply-To: <1564583126.6561.15.camel@samsung.com> References: <1564583126.6561.15.camel@samsung.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfMEnwm0Mr7xQODdUuX/jdz34qlAmxkTy0YS4qAz8jXqR5Qee3FYAW+yDymie0AO9wWS+NphidTkmqqoWrHomTMpI5Xdhc9sJ4pr/5NZfWwO9PaEgFGsw VPoxcWX+Hzbq7oMbQjezSS3LoSNA7BKR7KBkPsnlFL2oY1pDxIahqsAM 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) {