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

Re: zle .redisplay sometimes eating up a line



On Mon, Jul 15, 2019 at 8:31 PM Sebastian Gniazdowski
<sgniazdowski@xxxxxxxxx> wrote:
> > What's your $ZSH_PATCHLEVEL?
>
> zsh-5.7.1-101-g09385d3

Good. This rules out a few bugs fixed recently that affect lprompth.

> > Could you post self-contained instructions for reproducing this?
>
> The instructions will be not fully self-contained, as the issue
> reveals itself with 3 plugins being loaded:
>
> [...]

This is too much. The first thing anyone trying to debug this will
have to do is reduce the number of steps that are necessary to
reproduce this bug. If you do it, it makes it that much more likely
someone will care enough to fix the bug.

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`.

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.

Roman.



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