From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18484 invoked from network); 8 Apr 2005 08:45:12 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 8 Apr 2005 08:45:12 -0000 Received: (qmail 44223 invoked from network); 8 Apr 2005 08:44:55 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 8 Apr 2005 08:44:55 -0000 Received: (qmail 608 invoked by alias); 8 Apr 2005 08:44:53 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21117 Received: (qmail 591 invoked from network); 8 Apr 2005 08:44:51 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 8 Apr 2005 08:44:51 -0000 Received: (qmail 43870 invoked from network); 8 Apr 2005 08:44:51 -0000 Received: from mail36.messagelabs.com (193.109.254.211) by a.mx.sunsite.dk with SMTP; 8 Apr 2005 08:44:44 -0000 X-VirusChecked: Checked X-Env-Sender: okiddle@yahoo.co.uk X-Msg-Ref: server-23.tower-36.messagelabs.com!1112949846!636189!1 X-StarScan-Version: 5.4.11; banners=-,-,- X-Originating-IP: [158.234.9.163] Received: (qmail 6962 invoked from network); 8 Apr 2005 08:44:06 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-23.tower-36.messagelabs.com with SMTP; 8 Apr 2005 08:44:06 -0000 Received: from trentino.logica.co.uk ([158.234.142.59]) by iris.logica.co.uk (8.12.3/8.12.3/Debian -4) with ESMTP id j388i6R9012225 for ; Fri, 8 Apr 2005 09:44:06 +0100 Received: from trentino.groupinfra.com (localhost [127.0.0.1]) by trentino.logica.co.uk (Postfix) with ESMTP id A91404AB1F for ; Fri, 8 Apr 2005 10:43:45 +0200 (CEST) X-VirusChecked: Checked X-StarScan-Version: 5.0.7; banners=.,-,- In-reply-to: <1050407225513.ZM17729@candle.brasslantern.com> From: Oliver Kiddle References: <1dc4e3890504061159601fb049@mail.gmail.com> <20050407172756.GA16416@DervishD> <1dc4e38905040711017a63b0ba@mail.gmail.com> <20050407181536.GD16712@DervishD> <1050407225513.ZM17729@candle.brasslantern.com> To: zsh-workers@sunsite.dk Subject: Re: Zsh clears prompt line. Feature or bug? Date: Fri, 08 Apr 2005 10:43:44 +0200 Message-ID: <4374.1112949824@trentino.groupinfra.com> 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=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 Bart wrote: > 3.23. How do I prevent the prompt overwriting output when there is no newline? This reminds me. I've been using the following modification to the print 80 spaces solution: precmd() { print -n "${(l.$COLUMNS.)}\e7${(l.$COLUMNS..\b.)}\e8\015" } That's 80 spaces, save cursor position, 80 backspaces, restore cursor. The \015 is not part of it: that resets the font. On at least xterm, pterm and dtterm, this solves the problem with selecting text. The problem with just printing 80 spaces was that if you then selected the last line with the mouse, it would select the spaces instead of a newline. The problem with Bart's $'\e[6n' solution is that the key buffer is lost so if you had already started typing the next command, it'd be lost when precmd() ran. Oliver