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

Multi-line update problem in zholi10.1

There's a problem in zholi10.1 where it will not update the screen
correctly when inserting characters into the first line of a multi-
line command.  You have to be using an auto-margin terminal with
character insert (in my case I'm using an xterm), to see the problem.

The code that is failing is in refreshline() where it checks if there
is some space at the end of the line that needs to be cleared.
Because it is checking the wrong variable (vcs instead of ccs) it
uses right-cursor to try to move to column 80 (one past the right
edge) which is not possible -- you can only get to column 80 in a
terminal like a vt100 by outputing a character in column 79.  This
causes the moveto() code to fail to advance to the next line, and
then the screen becomes really messed up.

I've appended a patch that fixes this problem.  It is possible that
with this fix the following check for i == 0 isn't needed:

    /* we've written out the new but yet to clear rubbish due to inserts */
        if (!*nl) {
            if ((i = (winw - ccs < char_ins ? winnw - ccs : char_ins)) == 0)

but I don't know the code well enough to know for sure.

---8<------8<------8<------8<---cut here--->8------>8------>8------>8---
Index: zle_refresh.c
@@ -490,7 +490,7 @@
 	for (; *nl && (*nl == *ol); nl++, ol++, ccs++) ;
 	if (!*nl) {
-	    if ((char_ins <= 0)	|| (vcs >= winw))  /* written everything */
+	    if ((char_ins <= 0)	|| (ccs >= winw))  /* written everything */
 	    else		/* we've got junk on the right yet to clear */
 		if (tccan(TCCLEAREOL) && (char_ins >= tclen[TCCLEAREOL])
---8<------8<------8<------8<---cut here--->8------>8------>8------>8---

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