From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 707 invoked from network); 19 Jul 2009 10:03:51 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.5 Received: from new-brage.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.254.104) by ns1.primenet.com.au with SMTP; 19 Jul 2009 10:03:51 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 9117 invoked from network); 19 Jul 2009 10:03:37 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 19 Jul 2009 10:03:37 -0000 Received: (qmail 26060 invoked by alias); 19 Jul 2009 10:03:23 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 27163 Received: (qmail 26036 invoked from network); 19 Jul 2009 10:03:22 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 19 Jul 2009 10:03:22 -0000 Received: from smtp5-g21.free.fr (smtp5-g21.free.fr [212.27.42.5]) by bifrost.dotsrc.org (Postfix) with ESMTP id BD6AE8027106 for ; Sun, 19 Jul 2009 12:03:18 +0200 (CEST) Received: from smtp5-g21.free.fr (localhost [127.0.0.1]) by smtp5-g21.free.fr (Postfix) with ESMTP id 11638D480ED; Sun, 19 Jul 2009 12:03:15 +0200 (CEST) Received: from xvii.vinc17.org (c5850-a2-3-62-147-11-212.dial.proxad.net [62.147.11.212]) by smtp5-g21.free.fr (Postfix) with ESMTP id 2D7BDD480BD; Sun, 19 Jul 2009 12:03:12 +0200 (CEST) Received: from vinc17 by xvii.vinc17.org with local (Exim 4.69) (envelope-from ) id 1MST3k-0003tp-SE; Sun, 19 Jul 2009 11:51:56 +0200 Date: Sun, 19 Jul 2009 11:51:56 +0200 From: Vincent Lefevre To: zsh-workers@sunsite.dk Subject: Re: zsh 4.3.10 terminates with SIGINT when one types Ctrl-G in emacs under Mac OS X Message-ID: <20090719095156.GA14351@xvii> Mail-Followup-To: zsh-workers@sunsite.dk References: <090712193623.ZM14823@torch.brasslantern.com> <200907131839.n6DIdO6Z003291@pws-pc.ntlworld.com> <20090716162419.GA26179@prunille.vinc17.org> <090717222936.ZM8648@torch.brasslantern.com> <20090718101602.GA5392@xvii> <090718113509.ZM10405@torch.brasslantern.com> <20090718230930.GB5412@xvii> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20090718230930.GB5412@xvii> X-Mailer-Info: http://www.vinc17.org/mutt/ User-Agent: Mutt/1.5.20-5983-vl-r30292 (2009-07-14) X-Virus-Scanned: ClamAV 0.94.2/9589/Sun Jul 19 05:14:56 2009 on bifrost X-Virus-Status: Clean In fact, it seems that zsh implements some form of WCE in interactive scripts, whereas bash implements it in any case. Consider the following shell script: sigint() { echo "SIGINT (sh)"; } for i in 0 1 2 3 do trap - INT [ "$i" -eq 1 ] && trap sigint INT perl -e $i' or $SIG{"INT"} = sub { print "SIGINT (perl)\n" }; print "'$i' - $$\n"; sleep 30; $SIG{"INT"} = "DEFAULT"; kill "INT", $$' done Under Linux, whether this script is run in an interactive shell or not (zsh or another one), I always get something like: 0 - 7387 ^CSIGINT (perl) and the script is immediately interrupted. Now, remove the $SIG{"INT"} = "DEFAULT"; kill "INT", $$ so that in the case i = 0, the Perl script is no longer killed by SIGINT. Now, depending on the shell and how the script is started, the script is interrupted either for i = 0 or i = 2 (the latter more of less corresponds to WCE, i.e. the sh script is interrupted only if the Perl script is killed by SIGINT). I considered the following two cases: 1. " script.sh" 2. ". script.sh" from the interactive shell and I get the following results with: bash 3.2-5 (whether executed as bash or sh) dash 0.5.5.1-2 ksh 93t+-2 (ksh93) pdksh 5.2.14-23 posh 0.6.18 zsh 4.3.10-3 under Debian/unstable. * bash[1], dash[2], ksh93[1], pdksh[2], zsh[2] 0 - 7062 ^CSIGINT (perl) 1 - 7063 ^CSIGINT (sh) 2 - 7066 ^C * bash[2] 0 - 7241 ^CSIGINT (perl) 1 - 7242 ^C 2 - 7243 ^C * dash[1], ksh93[2], pdksh[1], posh[1], posh[2], zsh[1] 0 - 7387 ^CSIGINT (perl) Note that ksh93 does the opposite to pdksh and zsh! -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)