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

Re: Zsh clears prompt line. Feature or bug?



Bart wrote:
> 3.23. How do I prevent the prompt overwriting output when there is no newline?

This reminds me. I've been using the following modification to the print
80 spaces solution:

  precmd() { print -n "${(l.$COLUMNS.)}\e7${(l.$COLUMNS..\b.)}\e8\015" }

That's 80 spaces, save cursor position, 80 backspaces, restore cursor.
The \015 is not part of it: that resets the font.

On at least xterm, pterm and dtterm, this solves the problem with
selecting text. The problem with just printing 80 spaces was that if you
then selected the last line with the mouse, it would select the spaces
instead of a newline. The problem with Bart's $'\e[6n' solution is that
the key buffer is lost so if you had already started typing the next
command, it'd be lost when precmd() ran.

Oliver




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