-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prompt jumps up a line on certain actions #42
Comments
As I was playing with this and writing the initial description, I realized that if I hit |
I think maybe this only happens with multi-line prompts. I'll try to narrow it down. I was able to reproduce it with the standard A quick workaround is to disable the automatic tweaking of the prompt by setting MODE_INDICATOR=
source ~/path/to/zsh-vim-mode/zsh-vim-mode.plugin.zsh I will see if I can find out what is causing this problem, but hopefully that workaround will help in the mean time. |
This appears to be a Zsh bug. I narrowed it down to this minimal autoload -Uz promptinit; promptinit
prompt redhat
PS1='%!
%# '
autoload -Uz add-zle-hook-widget
test-zle-reset-hook () { zle reset-prompt; }
add-zle-hook-widget line-pre-redraw test-zle-reset-hook I was not able to get it to happen with a plain |
The |
I think I've seen this with a few different actions but the one that I know is repeatable is when I type 'S' in command mode. The following sequence does it for me reliably.
<esc>
SAt this time, the prompt jumps up deleting whatever line came before it. In my case, I use a two-line prompt, and both lines in the prompt jump up to delete the line of output before them.
To illustrate, I open up a new terminal and echo some output. At this point, my terminal looks like this:
Then, I hit
<esc>
S and my terminal looks like this:Notice that the line of output following the echo got eaten and my prompt is now one line higher in the terminal than it started at.
This is something I run into all the time because I often start typing a command, realize that I needed to run something different first, and I hit
<esc>
S to start over. Occasionally, some output that was important is clobbered by this bug.The text was updated successfully, but these errors were encountered: