zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh workers <zsh-workers@zsh.org>
Subject: Re: listlist() display corruption
Date: Sat, 19 Mar 2011 11:49:42 -0700	[thread overview]
Message-ID: <110319114942.ZM30393@torch.brasslantern.com> (raw)
In-Reply-To: <AANLkTikVS3XcV91hMveXD=qRimibHCP9qpgHXMqTP7k2@mail.gmail.com>

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) {


      reply	other threads:[~2011-03-19 18:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-19 17:54 Mikael Magnusson
2011-03-19 18:49 ` Bart Schaefer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=110319114942.ZM30393@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).