From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27960 invoked from network); 26 Mar 2001 17:04:38 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 26 Mar 2001 17:04:38 -0000 Received: (qmail 23574 invoked by alias); 26 Mar 2001 17:04:32 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13782 Received: (qmail 23558 invoked from network); 26 Mar 2001 17:04:31 -0000 Message-ID: To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: `jobs | wc -l' => 0 ... bug? In-Reply-To: Your message of "Mon, 26 Mar 2001 16:48:37 GMT." <1010326164837.ZM13050@candle.brasslantern.com> Date: Mon, 26 Mar 2001 17:04:07 +0000 From: Peter Stephenson > On Mar 26, 3:29pm, Peter Stephenson wrote: > } Subject: Re: `jobs | wc -l' => 0 ... bug? > } > } > $ jobs | wc -l > } > 0 > } > } jobs here runs in a subshell, where there is no job control, so no > } information on jobs. It has always been this way. It's not particularly > } convenient, however. Maybe it's time someone thought about changing it. > > What do you suggest, that we special-case the "jobs" command? Clearing the job table is handled specially in entersubsh(). if (cl) clearjobtab(); MONITOR gets unset at this point, too. It shouldn't be necessary to do both, and it should be possible to hack bin_fg() so that it can still list jobs even if it can't control them. In fact, it looks like this is half there: `fg' and `bg' test for !jobbing and complain, whereas `jobs' doesn't and silently scans the empty job list. So maybe not clearing the job table and relying on the option setting just works. But it needs a proper work through to make sure. -- Peter Stephenson Software Engineer CSR Ltd., Unit 300, Science Park, Milton Road, Cambridge, CB4 0XL, UK Tel: +44 (0)1223 392070