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

Re: Bug report



On Dec 17,  9:11am, Bart Schaefer wrote:
}
} This may in fact be another spot in the prompt code that needs to know
} that there is no right-indent.  That might actually fix the issue with
} scrolling up one line, too, on some terminals.

OK, I have tracked this down (and rebuilt my memory) ...

Remember what I said about how some terminals scroll when you write to
the last character, and other don't, and it's not possible to tell
which is which?  This applies to the end of any line, not just to the
lower right corner.  The corner just happens to be the only case where
scrolling actually pushes something off the top.

Src/Zle/zle_refresh.c:moveto() knows that the last character that was
output for the right-prompt was in the rightmost column.  What it does
not know is whether that left the cursor AT the rightmost column, or
whether it wrapped around to the next line.

In order to know what to do next, it has to know where the cursor is.
So it outputs space-backspace, which is guaranteed to make ANY terminal
behave like one of the terminals where the cursor has already wrapped
around to the next line.  Unfortunately this steps on the first character
of whatever was below the prompt.

Now it knows where the cursor is, so it can move up one line to place
the cursor properly within the line containing the prompt.

So to "fix" this (other than by going back to a minimum right-indent of
one), we have to re-implement moveto() in some way that allows it to
"know" where the cursor is after writing to the rightmost column.  There
may not be a way to do this without causing a lot of flickery cursor
motion.



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