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

Re: zle .redisplay sometimes eating up a line

On Mon, 15 Jul 2019 at 20:44, Roman Perepelitsa
<roman.perepelitsa@xxxxxxxxx> wrote:
> Since the prompt overflow bugs have been ruled out, the next most
> common reason for the prompt to be redisplayed on the previous line is
> when `redisplay` is called after a prior prompt change that wasn't
> followed by `zle -R`. Here's a simple example:
> 1. Run `zsh -df`.
> 2. Paste this:
>     function reset() { zle .reset-prompt; zle .redisplay }
>     zle -N reset
>     bindkey '^T' reset
>     PROMPT=$'\n> '
> 3. Press Ctrl-T. Observe that prompt moves one line up.
> The fix is to call `zle -R` before `zle .redisplay`.

BIG thanks! Adding zle -R before .redisplay call fixed my original
problem, and also the demonstration-sample.

> I'm not saying this is the culprit of your problem but it might be.
> It's hard to tell when the setup for reproducing it requires thousands
> of lines of ZSH scripts.

It was difficult to narrow down the issue as it was hidden somewhere
in the scripts.

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