Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PROMPT_SP bug with local in precmd
- X-seq: zsh-workers 28459
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: PROMPT_SP bug with local in precmd
- Date: Fri, 26 Nov 2010 22:53:16 +0000
- In-reply-to: <101126093810.ZM25915@xxxxxxxxxxxxxxxxxxxxxx>
- 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> <101126093810.ZM25915@xxxxxxxxxxxxxxxxxxxxxx>
On Fri, 26 Nov 2010 09:38:10 -0800
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> 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.
I think the following demonstrates the opposite, i.e. the exit message
now always appears on a newline, but as it's race prone it's hard
to be sure. I hope I'm not undoing any magic with this.
Index: Src/utils.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/utils.c,v
retrieving revision 1.249
diff -p -u -r1.249 utils.c
--- Src/utils.c 26 Nov 2010 18:50:22 -0000 1.249
+++ Src/utils.c 26 Nov 2010 22:48:46 -0000
@@ -1293,6 +1293,7 @@ preprompt(void)
opts[PROMPTPERCENT] = percents;
zputs(str, shout);
fprintf(shout, "%*s\r%*s\r", (int)columns - w - !hasxn, "", w, "");
+ fflush(shout);
free(str);
}
--
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author