Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: listlist() display corruption



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



Messages sorted by: Reverse Date, Date, Thread, Author