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

Re: Bug with the new prompt redraw code

On Mon, 12 Jul 2004, Peter Stephenson wrote:

> Bart Schaefer wrote:
> > So, what about (1)?  To repeat, the intent was to display a multi-line 
> > prompt immediately after a command finishes, but then refresh only the 
> > last line of that prompt on subsequent zle redisplays (the original 
> > example involved SIGWINCH handling).
> It sounds like zrefresh() should be moved earlier, out of zlecore().
> This means zle-line-init is basically the last thing executed before the
> editor starts looking for input.  Hence zle-line-init will only affect
> the next prompt, but the previous prompt will have been drawn.

This does sound like the approach that I asked for, and the C code seems 
to do the intended things, but it doesn't quite achieve the visible effect 
that I wanted.

The PS1 prompt as set at precmd time does indeed display, regardless of 
any change made in zle-line-init.

However, upon receiving SIGWINCH, the old prompt is still redrawn.  The 
new prompt doesn't kick in until "zle reset-prompt" is run ... but if one 
runs reset-prompt from zle-line-init, it immediately erases the old prompt 
and redraws, so we're almost back where we started.  The specific case of 
redrawing only the last line of a multi-line prompt *does* work, but only 
when the one-line PS1 assigned in zle-line-init is indistinguishable from 
the last line of the multi-line PS1 assigned in precmd, if you see what I 

I tried using a TRAPWINCH but that doesn't get executed until _after_ zle 
has had it's shot at the signal, so one always gets at least one spurious 
redraw of the old PS1 before anything can be done about it.

At this point it's probably not worth messing with further, though there 
does not seem to be any harm in committing 20153.

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