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

Re: Prompt redrawing issues with wrapped prompt on SIGWINCH



On Sat, Apr 18, 2015 at 12:56 AM, Daniel Hahler
<genml+zsh-workers@xxxxxxxxxx> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I am seeing weird redrawing issues when resizing the terminal window with the prompt at the bottom, and the prompt needs to be rewrapped.
>
> TEST CASE:
>
> 1. zsh -f
> 2. setopt promptsubst
> 3. PS1="\${(pl:\$((\$COLUMNS))::=:)} %# "
>
> Now fill the terminal window, e.g. with "ls", so that the prompt gets displayed at the bottom.
>
> When resizing the terminal window now, Zsh does not redraw itself properly: the prompt will moves upwards, overwriting output from "ls".
>
> This also happens with a static PS1, when the window gets too narrow:
>
> PS1="===================================== %# "
>
>
> There is no clear pattern in what goes wrong. With my prompt it will also duplicate the first part of it, and it seems to make a difference if the first line is "full" before the linebreak.

Urxvt reflows long lines on resize and obviously this happens before
zsh gets a chance to redraw the prompt. I don't know if there's any
possible way zle can know how the cursor moved because of this, and
especially difficult is to know how much the display scrolled.

-- 
Mikael Magnusson



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