Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: coloring STDERR to terminal
- X-seq: zsh-users 7662
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: coloring STDERR to terminal
- Date: Fri, 2 Jul 2004 14:32:28 -0700 (PDT)
- In-reply-to: <20040702124259.GS2033@xxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20040627190433.Q27888@willy_wonka> <Pine.LNX.4.60.0406280815130.19831@xxxxxxxxxxxxxxxxxx> <20040629160826.GL2033@xxxxxxxxxxxxx> <Pine.LNX.4.60.0406291002300.31134@xxxxxxxxxxxxxxxxxx> <20040630070902.GO2033@xxxxxxxxxxxxx> <Pine.LNX.4.60.0406300311020.5600@xxxxxxxxxxxxxxxxxx> <20040630114341.GR2033@xxxxxxxxxxxxx> <Pine.LNX.4.60.0406300906100.5600@xxxxxxxxxxxxxxxxxx> <20040701181459.GF2033@xxxxxxxxxxxxx> <Pine.LNX.4.60.0407011645450.16728@xxxxxxxxxxxxxxxxxx> <20040702124259.GS2033@xxxxxxxxxxxxx>
- Reply-to: zsh-users@xxxxxxxxxx
On Fri, 2 Jul 2004, Vincent Lefevre wrote:
> Now, in precmd(), adding the following line solves the problem:
>
> sleep 0
>
> Of course, this won't completely avoid the race condition, but it
> improves things in pratice. I assume that this forces the scheduler
> to switch to another process, and in practice, the coprocess is
> scheduled before precmd() is resumed.
As sleep is an external command rather than a builtin (cf. zselect), this
forces zsh to perform a wait() system call [more or less], which in turn
forces the scheduler to let the sleep run to completion before zsh wakes
up again. That it's specifically "sleep 0" is probably irrelevant; any
external command is likely to have the same effect.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author