From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27100 invoked from network); 9 Apr 2005 23:47:18 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 9 Apr 2005 23:47:18 -0000 Received: (qmail 96840 invoked from network); 9 Apr 2005 23:47:12 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 9 Apr 2005 23:47:12 -0000 Received: (qmail 21331 invoked by alias); 9 Apr 2005 23:47:08 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21128 Received: (qmail 21316 invoked from network); 9 Apr 2005 23:47:08 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 9 Apr 2005 23:47:08 -0000 Received: (qmail 96558 invoked from network); 9 Apr 2005 23:47:07 -0000 Received: from sccrmhc13.comcast.net (204.127.202.64) by a.mx.sunsite.dk with SMTP; 9 Apr 2005 23:47:03 -0000 Received: from madstop.pimlott.net ([24.4.236.18]) by comcast.net (sccrmhc13) with ESMTP id <20050409234700016001o9foe>; Sat, 9 Apr 2005 23:47:01 +0000 Received: from andrew by madstop.pimlott.net with local (Exim 3.35 #1 (Debian)) id 1DKPfI-0004YX-00; Sat, 09 Apr 2005 16:47:00 -0700 Date: Sat, 9 Apr 2005 16:47:00 -0700 From: Andrew Pimlott To: Bart Schaefer , 303623-quiet@bugs.debian.org Cc: zsh-workers@sunsite.dk Subject: Re: Bug#303623: [andrew@pimlott.net: Bug#303623: zsh: CHECK_JOBS doesn't work when only one command was run since last Control-D] Message-ID: <20050409234700.GP12293@pimlott.net> References: <20050407191059.GA11437@scowler.net> <1050408000543.ZM18067@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1050408000543.ZM18067@candle.brasslantern.com> User-Agent: Mutt/1.5.6+20040907i X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 On Fri, Apr 08, 2005 at 12:05:42AM +0000, Bart Schaefer wrote: > On Apr 7, 3:10pm, Clint Adams wrote: > } > } When a job is still running and the CHECK_JOBS is set, zsh should only > } exit when it receives two exit requests in a row. However, sometimes it > } honors an exit request in other conditions. One repeatable case is when > } the request is a Control-D and there was only one command run since the > } last exit request. > > The issue here seems to be that zsh doesn't actually receive a ctrl-D > keystroke, but rather that there is a true end-of-file on the tty. Ok, but I don't think this should preclude correct behavior. My understanding is that when is pressed, the application gets a zero-length read on the terminal, but that a subsequent read will get more keyboard input (or another zero-length read if is pressed again). So zsh should still be able to detect each press of reliably. > If you try, for example, running zsh and then starting another zsh from > within the first, then when you force the "inner" zsh to exit, the "outer" > one sometimes exits as well. Hmm, mysterious. I should have also said in my message that I think I've seen unexpected exits in other cases, but the one I posted is the only one I could reproduce. It sounds like there is a subtle bug in zsh. > There may actually be some kind of race condition here, because sometimes > only the "inner" shell exits. It might even be an xterm bug. > > Here's a much simpler example to reproduce the base problem: Right, I should have explained that I gave a longer example to show that 1) exit and act differently and 2) running two commands between s behaves as expected. Andrew