From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5031 invoked from network); 4 Nov 2007 23:49:18 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 4 Nov 2007 23:49:18 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 57416 invoked from network); 4 Nov 2007 23:49:10 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 4 Nov 2007 23:49:10 -0000 Received: (qmail 29684 invoked by alias); 4 Nov 2007 23:49:03 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12190 Received: (qmail 29660 invoked from network); 4 Nov 2007 23:49:02 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 4 Nov 2007 23:49:02 -0000 Received: (qmail 56227 invoked from network); 4 Nov 2007 23:49:02 -0000 Received: from vms040pub.verizon.net (206.46.252.40) by a.mx.sunsite.dk with SMTP; 4 Nov 2007 23:48:56 -0000 Received: from torch.brasslantern.com ([71.116.71.62]) by vms040.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0JR0000DWA55OW17@vms040.mailsrvcs.net> for zsh-users@sunsite.dk; Sun, 04 Nov 2007 17:48:42 -0600 (CST) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id lA4Nmd38022920 for ; Sun, 04 Nov 2007 15:48:40 -0800 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id lA4NmdRI022919 for zsh-users@sunsite.dk; Sun, 04 Nov 2007 15:48:39 -0800 Date: Sun, 04 Nov 2007 15:48:39 -0800 From: Bart Schaefer Subject: Re: since 4.3.4, artifact-appearance at prompt In-reply-to: <20071104221621.GB28076@blorf.net> To: zsh-users@sunsite.dk Message-id: <071104154839.ZM22918@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <20071103234335.GB10499@panix.com> <071103183038.ZM8388@torch.brasslantern.com> <20071104034810.GA3923@panix.com> <20071104070008.15348.qmail@smasher.org> <071104094803.ZM22628@torch.brasslantern.com> <20071104221621.GB28076@blorf.net> Comments: In reply to Wayne Davison "Re: since 4.3.4, artifact-appearance at prompt" (Nov 4, 2:16pm) On Nov 4, 2:16pm, Wayne Davison wrote: } Subject: Re: since 4.3.4, artifact-appearance at prompt } } On Sun, Nov 04, 2007 at 09:48:03AM -0800, Bart Schaefer wrote: } > function precmd { } > # An efficient version using termcap multi-right: } > print -nP '%B%S%#%s%b' # Output % or # } > echotc RI $((COLUMNS - 3)) } > echo -n ' ' # Output 2 spaces } > } } } You should replace the 2-space echo with a print that also outputs a CR: } } print -n ' \r' In that case we ought to update both the FAQ, and the C code that handles PROMPT_SP. I copied the above right out of the FAQ, except for changing the first "print". } Yes, the PROMPT_CR option is going to output a CR too, but it does so } after enough of a delay that I would sometimes see an inverted % on an } empty line if my type-ahead echoed between the PROMPT_SP output and the } PROMPT_CR output. This appears to be what Russell is experiencing, too. } It is better to output the %P portion as early as possible in the } post-command-run code, so outputting it as an actual part of the prompt } would probably not be desirable. I'm willing to believe that. } e.g.: } } PROMPTSP=%{%B%S%}%#%{%s%b%} The internals of prompting already know that %B%S and %s%b don't occupy any space. %{...%} shouldn't be needed there. } However, an alternative to having the user use %{ ... %} would be to } have the user just tell us how wide their string is: } } PROMPTSP=1:%B%S%#%s%b The countprompt() function is exported from prompt.c for ZLE's use, so I don't think there's much to be gained there.