From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26782 invoked from network); 4 Nov 2007 22:16:44 -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 22:16:44 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 4616 invoked from network); 4 Nov 2007 22:16:36 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 4 Nov 2007 22:16:36 -0000 Received: (qmail 13679 invoked by alias); 4 Nov 2007 22:16:28 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12188 Received: (qmail 13664 invoked from network); 4 Nov 2007 22:16:28 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 4 Nov 2007 22:16:28 -0000 Received: (qmail 3496 invoked from network); 4 Nov 2007 22:16:28 -0000 Received: from dsl-74-220-69-132.cruzio.com (HELO dot.blorf.net) (74.220.69.132) by a.mx.sunsite.dk with SMTP; 4 Nov 2007 22:16:23 -0000 Received: by dot.blorf.net (Postfix, from userid 1000) id 2B8B418574; Sun, 4 Nov 2007 14:16:21 -0800 (PST) Date: Sun, 4 Nov 2007 14:16:21 -0800 From: Wayne Davison To: Bart Schaefer Cc: zsh-users@sunsite.dk Subject: Re: since 4.3.4, artifact-appearance at prompt Message-ID: <20071104221621.GB28076@blorf.net> References: <20071103234335.GB10499@panix.com> <071103183038.ZM8388@torch.brasslantern.com> <20071104034810.GA3923@panix.com> <20071104070008.15348.qmail@smasher.org> <071104094803.ZM22628@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <071104094803.ZM22628@torch.brasslantern.com> User-Agent: Mutt/1.5.16 (2007-06-11) 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' This makes it less likely that the user's type-ahead after this output will cause the screen to scroll (and is what the current code does). 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. > PS1=%P{%B%S%#%s%b}$PS1" > > Any thoughts from the -workers on that? 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. The PS1 string could get carved up into early and normal prompt pieces, but it would probably just be better to have an environment variable that specifies what to output. e.g.: PROMPTSP=%{%B%S%}%#%{%s%b%} 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 ..wayne..