From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24772 invoked from network); 11 May 2001 15:54:11 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 11 May 2001 15:54:11 -0000 Received: (qmail 4500 invoked by alias); 11 May 2001 15:54:07 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14316 Received: (qmail 4489 invoked from network); 11 May 2001 15:54:06 -0000 From: "Bart Schaefer" Message-Id: <1010511155257.ZM5424@candle.brasslantern.com> Date: Fri, 11 May 2001 15:52:57 +0000 In-Reply-To: <200105110847.KAA06216@beta.informatik.hu-berlin.de> Comments: In reply to Sven Wischnowsky "Re: Odd job-reporting buglet (Re: Change in suspend behavior)" (May 11, 10:47am) References: <200105110847.KAA06216@beta.informatik.hu-berlin.de> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.dk Subject: Re: Odd job-reporting buglet (Re: Change in suspend behavior) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On May 11, 10:47am, Sven Wischnowsky wrote: } } Bart Schaefer wrote: } } > schaefer[501] for i in bar foo; do cat & wait; done } > [2] 27451 } > [2] + suspended (tty input) cat } > [1] 27452 } > [1] + suspended (tty input) cat } > zsh: suspended (tty input) cat | } > zsh: running for i in bar foo; do; cat & wait; done } } The reason is pretty clear (to some): the sub-job returns and is } stopped, so execpline() things it has to do all that super/sub-job } handling it does when the sub-job was suspended with ^Z. This happens only because of the `wait' command, right? It does *not* happen when I do `for i in bar foo; do; cat & sleep 5; done'. } One way to try to fix this is to make execpline() check if the sub-job } really was suspended because of a ^Z (SIGTSTP). One can send TSTP with a `kill'. Testing for TSTP has to be combined with a test for whether the job is the foreground job at the time. } The other way to try to fix this would be to check if the sub-job was } ASYNC (i.e. it had a `&' at the end), pass that information up to (the } right) execpline() and there decide to not wrap it into a super-job. That sounds closer to the right thing to me, but wouldn't a test for "is the foreground job" be equivalent (and possibly not need any more info to be passed around)? Or maybe it would be possible to know that we're in a `wait' command and simply not do any of this processing? But that would be equivalent to "is this the foreground job" as well (as the `wait' would be the fore- ground job in that case, not the job that got the signal). -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net