From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22401 invoked by alias); 19 Mar 2011 18:50:13 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28926 Received: (qmail 24548 invoked from network); 19 Mar 2011 18:50:02 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <110319114942.ZM30393@torch.brasslantern.com> Date: Sat, 19 Mar 2011 11:49:42 -0700 In-reply-to: Comments: In reply to Mikael Magnusson "listlist() display corruption" (Mar 19, 6:54pm) References: X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh workers Subject: Re: listlist() display corruption MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Mar 19, 6:54pm, Mikael Magnusson wrote: } Subject: listlist() display corruption } } listlist(), used among other places in list-expand and where-is, moves } the prompt one line down every time it executes if any of the elements } it tries to show is longer than the terminal width. To try it, touch a } long filename (or make the terminal narrower) and type part of it's } name and a * and run list-expand. Alternatively, run where-is and type } history-incr, make the terminal quite narrow, and press tab a few } times. There are a couple of things going on here. For one, resizing the window doesn't always correctly reset $COLUMNS [which is columns in listlist()] so the computation of number of lines required is not always correct. Not sure what can be done about that, it's to do with whether the terminal delivers SIGWINCH. Another is the below; somebody confirm it works before I commit: Index: zle_tricky.c =================================================================== RCS file: /extra/cvsroot/zsh/zsh-4.0/Src/Zle/zle_tricky.c,v retrieving revision 1.30 diff -c -r1.30 zle_tricky.c --- zle_tricky.c 21 Dec 2010 16:41:16 -0000 1.30 +++ zle_tricky.c 19 Mar 2011 18:44:58 -0000 @@ -2650,7 +2650,9 @@ } else { for (p = data; *p; p++) { nicezputs(*p, shout); - putc('\n', shout); + /* One column: newlines between elements, not after the last */ + if (p[1]) + putc('\n', shout); } } if (clearflag) {