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

Re: [PATCH] use clear-to-end to reduce trailing whitespace



On 9 Feb, Daniel Colascione wrote:
> Thanks for testing. Is there any way you can give me a more precise
> recipe for reproducing the issue you're describing with the second,
> improved patch?  When I start up urxvt (v9.31) and fill the terminal

I've been able to narrow it down to minimal steps to reproduce, it
entails a part of my setup for making the vi mode visible but I don't
think I'm unusual in doing that and zle reset-prompt is common in hooks
generally. I've verified the steps in urxvt 9.31, xterm 396 and
lxterminal so my use of urxvt before may be inconsequential.

Setup steps are:

  zsh -df
  bindkey -v
  zle-keymap-select() {
    RPS1="(CMD)"
    zle reset-prompt
  }
  zle -N zle-keymap-select
  PS1="abcdefghijklmnopqrstuvwxyz%% "
  RPS1=""

I used a small window - 9 51 from the following.
  echo $LINES $COLUMNS

Now enter a line, preferably quite long because if it wraps you can see
the problem more clearly, e.g:

  0123456789 0123456789 0123456789

At this point, your cursor should already be on the last line of the
terminal but if not, press <enter> until it is. Now press <escape> for
vi command mode and this is the point where the problem occurs because
it scrolls up by a line. This puts the display out of sync with what the
code thinks it has. So if you now fill out more lines, e.g. with the vi
commands yyppppppp then it will scroll the left prompt off the top and
preserve whatever text scrolled into the prompt position as if that was
the prompt.

To repeat the test with a fresh command-line, remember to reset RPS1 to "".

Oliver




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