From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16956 invoked by alias); 27 Nov 2010 00:15:36 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28459 Received: (qmail 18005 invoked from network); 27 Nov 2010 00:14:47 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at ntlworld.com designates 81.103.221.56 as permitted sender) Date: Fri, 26 Nov 2010 22:53:16 +0000 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: PROMPT_SP bug with local in precmd Message-ID: <20101126225316.325fa5ca@pws-pc.ntlworld.com> In-Reply-To: <101126093810.ZM25915@torch.brasslantern.com> References: <20101126115148.GT1254@prunille.vinc17.org> <101126093810.ZM25915@torch.brasslantern.com> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.1 cv=X0sWjjQ37bMP4yB/pNNinY3VxVB2n/hmdAjhihaCFGs= c=1 sm=0 a=3VrKnBqHxFsA:10 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8 a=NLZqzBF-AAAA:8 a=PpSwncu8cqxl6AK44LgA:9 a=VwHoeEdVSSJ4mpyVtsEA:7 a=m0xt8RpOjnOX9skTuxb7wEXLPoEA:4 a=CjuIK1q_8ugA:10 a=I6wTmPyJxzYA:10 a=_dQi-Dcv4p4A:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 On Fri, 26 Nov 2010 09:38:10 -0800 Bart Schaefer 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 Web page now at http://homepage.ntlworld.com/p.w.stephenson/