From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19750 invoked from network); 1 Mar 2005 09:25:55 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 1 Mar 2005 09:25:55 -0000 Received: (qmail 3011 invoked from network); 1 Mar 2005 09:25:49 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 1 Mar 2005 09:25:49 -0000 Received: (qmail 8608 invoked by alias); 1 Mar 2005 09:25:41 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20896 Received: (qmail 8593 invoked from network); 1 Mar 2005 09:25:40 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 1 Mar 2005 09:25:40 -0000 Received: (qmail 2342 invoked from network); 1 Mar 2005 09:25:40 -0000 Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by a.mx.sunsite.dk with SMTP; 1 Mar 2005 09:25:36 -0000 Received: from root by ciao.gmane.org with local (Exim 4.43) id 1D63Yf-00029M-SX for zsh-workers@sunsite.dk; Tue, 01 Mar 2005 10:20:50 +0100 Received: from quack.cs.berkeley.edu ([128.32.132.234]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 01 Mar 2005 10:20:49 +0100 Received: from quarl by quack.cs.berkeley.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 01 Mar 2005 10:20:49 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-workers@sunsite.dk From: Karl Chen Subject: promptcr workaround Date: Tue, 01 Mar 2005 00:17:43 -0800 Message-ID: Reply-To: quarl+dated+1110096615.ea06d0@nospam.quarl.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: quack.cs.berkeley.edu X-Quack-Archive: 1 Gmane-From: 1 User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:56TkFy7X2WXQUkdKg1OR3WdtLyo= Sender: news X-Gmane-MailScanner: Found to be clean X-Gmane-MailScanner: Found to be clean X-MailScanner-From: gcszd-zsh-workers@m.gmane.org X-MailScanner-To: zsh-workers@sunsite.dk X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 I've always been unsatisfied with the answer to FAQ entry 3.23 "How do I prevent the prompt overwriting output when there is no newline?" I dislike zsh's promptcr behavior both on and off. I don't like silently losing the last line nor having a messed-up prompt, and didn't like adding an extra newline on every command. Here's a way to simulate adding the \n only when necessary: function precmd { echo -n ${(l:$COLUMNS:::)} } This prints $COLUMNS spaces. Iff there's any output on the line already, it'll wrap to somewhere on the next line. So when zsh prints the \r it'll always erase only spaces. -- Karl 2005-03-01 00:10