From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4047 invoked by alias); 8 Sep 2010 08:19:42 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28243 Received: (qmail 22648 invoked from network); 8 Sep 2010 08:19:40 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <100908011924.ZM13750@torch.brasslantern.com> Date: Wed, 08 Sep 2010 01:19:24 -0700 In-reply-to: <20100907192617.GA22081@prunille.vinc17.org> Comments: In reply to Vincent Lefevre "Re: prompt problem" (Sep 7, 9:26pm) References: <20100820122823.GA4702@ypig.lip.ens-lyon.fr> <20100907192617.GA22081@prunille.vinc17.org> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: prompt problem MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Sep 7, 9:26pm, Vincent Lefevre wrote: } } Any news? My guess would be that this is a race condition of some kind. In some cases the TRAPCLD function gets called twice on a single interrupt. It's somewhat easier to make this happen [and much easier to observe that it is what happens] if (a) you put a "print" statement in the precmd function and (b) you vary the number of seconds passed to each sleep in the pipe. When called twice, $? differs in each call -- it's 130 (INT) in the first call, and 0 in the second, in every case where I got two calls to happen at all. The race probably depends on which part of the pipeline gets signalled first -- something over which zsh has no control, as it's counting on the OS to kill the entire process group when managing of a pipeline. As a further guess, when the process group is killed zsh wakes up and starts to print the prompt when the SIGCHLD is received for the group leader. Another child in the group then exits, catching the internals of ZLE in a state where the prompt has been printed but it hasn't recorded that fact yet.