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

Re: terminal resizing and prompt problem

On Sat, 10 Jul 2004, Nathan Sommer wrote:

> For each character height I resize vertically, or each character width I 
> resize horizontally, the top line of my prompt is repeated.
> This is terribly annoying, since it means I can't resize my terminal to 
> see more output, since any additional visibility I would have gained is 
> taken up by the additional lines of my prompt.

Precisely how are you resizing the terminal?

Zsh reprints the prompt each time it gets a SIGWINCH signal.  Normally,
e.g. when dragging the window borders with the mouse, there would be only
a one such signal delivered at the time the mouse was released.

It sounds as though you -- or your window manager -- is performing e.g. 
six resizes of one line each rather than one resize of six lines, causing 
zsh to receive a stream of SIGWINCH signals.  This is not a bug in zsh.

When zsh reprints the prompt, it moves the cursor to the beginning of the 
line (prints a carriage return without a line feed) and then displays the 
prompt.  The line editor only keeps track of where it is on the current 
line, not what may have gone on before it got there, so it doesn't try to 
move up to wherever it was when the prompt began printing.  This could be 
considered a misfeature, but printing the prompt is entirely a separate 
action from editing the command line (the prompt is printed the same way 
whether ZLE is enabled or not).

However, you wouldn't notice (or at least it wouldn't be so annoying) if
your resizing signals weren't behaving so oddly.

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