From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12584 invoked from network); 22 Oct 2002 15:52:30 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 22 Oct 2002 15:52:30 -0000 Received: (qmail 25888 invoked by alias); 22 Oct 2002 15:51:28 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5456 Received: (qmail 25868 invoked from network); 22 Oct 2002 15:51:26 -0000 From: "Bart Schaefer" Message-Id: <1021022155051.ZM13080@candle.brasslantern.com> Date: Tue, 22 Oct 2002 15:50:51 +0000 In-Reply-To: <200210220249.g9M2nVO29377@throb.netspace.org> Comments: In reply to bperkins@netspace.org "signals in loops" (Oct 21, 10:49pm) References: <200210220249.g9M2nVO29377@throb.netspace.org> X-Mailer: Z-Mail (5.0.0 30July97) To: bperkins@netspace.org, zsh-users@sunsite.dk Subject: Re: signals in loops MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Oct 21, 10:49pm, bperkins@netspace.org wrote: } Subject: signals in loops } } I've been using zsh for a while, and I'd swear you used to be able to } do this: } } for foo in 1 2 3 4 5 6 ; do xmessage $foo; done } } and you could give control-c to kill the xmessage and the next one } would pop up. Yes, you did used to be able to do that. It was a bug. :-) To see why it was a bug, consider trying to interrupt this: while : ; do something; done } Which brings up a mostly acidemic question, what is the default } "trap?" There isn't any way to write the default signal handling behavior in the shell language. Effectively you're correct that it breaks from all loops on the INT or QUIT signals. On the TSTP signal, recent versions of zsh implicitly force the entire loop into a subshell in order to be able to stop it. Forking that sub- shell is delayed until the signal is actually received. -- 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