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

Re: _all_matches moves cursor



John Eikenberry wrote:
> I recently added _all_matches to my completion config [1] and have come
> across an annoying behaviour. When the '- all matches -' line is longer
> than my terminal is wide, the cursor (along with the command being
> completed) gets bounced down a line.

I found this in the latest code, and assumed it was due to my recent
changes, but I guessed you were using 4.2.x, and sure enough, unless the
shell is lying to me, it's there too.

Here's a slight cheat that simply shortens the line being added.  I
haven't the moral fibre to go back into the line-length calculations in
the completion system at the moment, but my conscience is easier since
the following is definitely safe with any form of terminal, whatever it
does when the character reaches the end of the line, and also prevents a
blank line appearing at the bottom of the screen.  I suspect, however,
the real problem is a calculation inside zsh rather than the terminal's
behaviour.

Further discussion of this ought to go on zsh-workers since it's down to
the internals, not John's settings.

Index: Src/Zle/compresult.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compresult.c,v
retrieving revision 1.65
diff -u -r1.65 compresult.c
--- Src/Zle/compresult.c	11 Aug 2006 21:30:38 -0000	1.65
+++ Src/Zle/compresult.c	6 Oct 2006 09:30:43 -0000
@@ -2134,7 +2134,7 @@
 			strcat(buf, " ");
 		    strncat(buf, m->str, len);
 		}
-		strcat(buf, " ...");
+		strcat(buf, " ..");
 		break;
 	    }
 	}

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php



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