zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: prompt problem
Date: Wed, 08 Sep 2010 01:19:24 -0700	[thread overview]
Message-ID: <100908011924.ZM13750@torch.brasslantern.com> (raw)
In-Reply-To: <20100907192617.GA22081@prunille.vinc17.org>

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.


  reply	other threads:[~2010-09-08  8:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-20 12:28 Vincent Lefevre
2010-09-07 19:26 ` Vincent Lefevre
2010-09-08  8:19   ` Bart Schaefer [this message]
  -- strict thread matches above, loose matches on Subject: below --
1996-12-17 12:51 Prompt problem Alexey Solovyov
1996-12-17 13:10 ` Goran Larsson
1996-12-17 13:24 ` gwing

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=100908011924.ZM13750@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).