Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: prompt problem
- X-seq: zsh-workers 28243
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: prompt problem
- Date: Wed, 08 Sep 2010 01:19:24 -0700
- In-reply-to: <20100907192617.GA22081@xxxxxxxxxxxxxxxxxxx>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20100820122823.GA4702@xxxxxxxxxxxxxxxxxxxx> <20100907192617.GA22081@xxxxxxxxxxxxxxxxxxx>
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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author