From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1169 invoked by alias); 24 Sep 2011 18:31:36 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16419 Received: (qmail 19440 invoked from network); 24 Sep 2011 18:31:23 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.220.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=QckgzU68L58QFTm0yK5gURD7yCEj5PS+XBNxOTAMV/g=; b=QWJovGuupQgRlsF+a04Ht/oI0SfJsY6WN95/DJCelC40Fpohnsz0WDlrFXjv6VJ2fC 6c2SWK0tZoCnegHyTN2dWXrbq4j1TsttAGWHg+9nXbIbFiTdNa3SzxQwkua5OD9aUv/j 4N8nmd8r+7rL2WDCGkpzTUueezYujq1p4qI4Y= MIME-Version: 1.0 In-Reply-To: <110924112412.ZM24918@torch.brasslantern.com> References: <110924112412.ZM24918@torch.brasslantern.com> Date: Sat, 24 Sep 2011 20:31:16 +0200 Message-ID: Subject: Re: prompts with newlines get printed twice From: Mikael Magnusson To: Bart Schaefer Cc: zsh-users@zsh.org Content-Type: text/plain; charset=UTF-8 On 24 September 2011 20:24, Bart Schaefer wrote: > On Sep 23, 7:52pm, Jorge Israel Pena wrote: > } > } The problem I'm encountering is that when I create a newline in the prompt, > } the prompt gets printed twice when I open the terminal. > > We've been wrestling with this one for a while. The trouble seems to be > that Terminal sends extra WINCH (window size change) signals to the shell, > which causes it to reprint the prompt. > > Zsh doesn't attempt to perform a cursor-up before printing the prompt, as > for command line editing purposes it only keeps track of the appearance of > the final line. I'm seeing some strange behaviour here, when I resize after setting PS1='%D{%s} hello there ' I do get the first line twice, but subsequent resizes properly redraws both lines in place, updating the time too. Pressing enter then causes the next resize to double the first line and then subsequent ones work again. -- Mikael Magnusson