From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18366 invoked from network); 26 Jul 2005 21:54:02 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 26 Jul 2005 21:54:02 -0000 Received: (qmail 58640 invoked from network); 26 Jul 2005 21:53:57 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 26 Jul 2005 21:53:57 -0000 Received: (qmail 16370 invoked by alias); 26 Jul 2005 21:53:54 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21532 Received: (qmail 16361 invoked from network); 26 Jul 2005 21:53:54 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 26 Jul 2005 21:53:54 -0000 Received: (qmail 58323 invoked from network); 26 Jul 2005 21:53:54 -0000 Received: from dsl3-63-249-88-2.cruzio.com (HELO dot.blorf.net) (63.249.88.2) by a.mx.sunsite.dk with SMTP; 26 Jul 2005 21:53:50 -0000 Received: by dot.blorf.net (Postfix, from userid 1000) id 27EC866C9; Tue, 26 Jul 2005 14:53:48 -0700 (PDT) Date: Tue, 26 Jul 2005 14:53:48 -0700 From: Wayne Davison To: Bart Schaefer Cc: Zsh hackers list Subject: Re: PATCH: PROMPT_SP Message-ID: <20050726215348.GA5990@blorf.net> References: <1050716160634.ZM31049@candle.brasslantern.com> <20050716195612.GA11575@blorf.net> <200507181032.j6IAWB4q022520@news01.csr.com> <20050718181330.GA19066@blorf.net> <1050723135554.ZM19813@candle.brasslantern.com> <20050723165301.GB16571@blorf.net> <20050723171955.GC16571@blorf.net> <1050724052757.ZM20380@candle.brasslantern.com> <20050724061011.GB19554@blorf.net> <1050724094938.ZM20755@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="EVF5PPMfhYS0aIcm" Content-Disposition: inline In-Reply-To: <1050724094938.ZM20755@candle.brasslantern.com> User-Agent: Mutt/1.5.9i X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.4 --EVF5PPMfhYS0aIcm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Jul 24, 2005 at 09:49:38AM +0000, Bart Schaefer wrote: > How about '%B%S%#%s%b' ? I've been using this suggestion for a couple days, and happened to notice that sometimes some user-input would echo between the precmd output and the PROMPT_CR output (causing a confusing wrap with the # in column 1), so I added a CR to the end of the precmd's output. I also simplified the code a bit (i.e. no more termcap RI). ..wayne.. --EVF5PPMfhYS0aIcm Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="faq.patch" --- FAQ.yo 19 Jul 2005 15:18:11 -0000 1.22 +++ FAQ.yo 26 Jul 2005 18:46:36 -0000 @@ -1664,13 +1664,10 @@ sect(How do I prevent the prompt overwri # Skip defining precmd if the PROMPT_SP option is available. if ! eval '[[ -o promptsp ]] 2>/dev/null'; then function precmd { - # An efficient version using termcap multi-right: - echo -n ' ' # Output 1 space - echotc RI $((COLUMNS - 3)) - echo -n ' ' # Output 2 spaces - # Alternately, try replacing the above 3 lines with this echo - # that outputs a screen-column-width of spaces: - #echo -n ${(l:$COLUMNS:::):-} + # Output an inverse hash and a bunch spaces. We include + # a CR at the end so that any user-input that gets echoed + # between this output and the prompt doesn't cause a wrap. + print -nP "%B%S#%s%b${(l:$((COLUMNS-1)):::):-}\r" } fi ) --EVF5PPMfhYS0aIcm--