Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PROMPT_SP bug with local in precmd
- X-seq: zsh-workers 28456
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: PROMPT_SP bug with local in precmd
- Date: Fri, 26 Nov 2010 09:38:10 -0800
- In-reply-to: <20101126115148.GT1254@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: <20101126115148.GT1254@xxxxxxxxxxxxxxxxxxx>
On Nov 26, 12:51pm, Vincent Lefevre wrote:
}
} ypig% precmd() { local v=bar }
} ypig% echo -n foo; false
} foozsh: exit 1
It's not "local" that triggers this, it's any command:
torch% precmd() { : }
torch% echo -n foo; false
foozsh: exit 1
torch% precmd() { echo -n Hi }
Hi%
torch% echo -n foo; false
foozsh: exit 1
Hi%
torch% precmd() { /bin/echo -n Hi }
Hi%
torch% echo -n foo; false
foozsh: exit 1
Hi%
zsh: exit 1
torch%
This makes me suspect it's not so much a bug as a race condition -- when
there is a command in precmd, the order in which the exit values from
children (even fake children) are collected and reported is changed.
Note how "zsh: exit 1" is printed twice when the precmd is a forked
process instead of all builtins.
My conclusion from this is that "foozsh: exit 1" is what you really
ought to be seeing all the time, and "zsh: exit 1" on its own line is a
side-effect of a stdio buffer never having been flushed.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author