zsh-vi-mode
zsh-vi-mode copied to clipboard
ZVM conflicts with bracketed paste
General information
- Terminal program: WezTerm v20230408.112425 (xterm-256color)
- Operating system: Amazon Linux 2 (5.10.184-153.749.amzn2int.x86_64)
- ZSH framework: antidote (but I had the same issue with a manual installation of ZVM)
- ZSH version: zsh 5.8.1 (x86_64-koji-linux-gnu)
- ZVM version: zsh-vi-mode 0.10.0
Basic examination
- [X] I have read through the README page
- [X] I have the latest version of zsh-vi-mode
- [ ] I have tested with another terminal program
Problem description
When bracketed paste is enabled in both zsh (this is the default behavior) and the terminal, pasting a oneliner in insert mode prints the clipboard text (as expected), but also switches to normal mode and flips the case of the character before the cursor (and all the ones after it, if the cursor was not at the end of the line).
This does not happen without bracketed paste. This also doesn't happen without ZVM.
It looks like the \e[201~
sequence at the end of the bracketed paste is intercepted by ZVM, which interprets it as user input. Indeed, after one undo the original text is restored. But of course it is annoying to undo and go back to insert mode every time I paste something...
Reproduction steps
- Use a terminal supporting bracketed paste, such as WezTerm
- Enable bracketed paste in the shell, if not already on
- Place some simple one-liner text in your clipboard, e.g.
Hello World
- Paste the text in zsh, in insert mode
- Observe that the text has become
Hello WorlD
and that you are in normal mode - Disable bracketed paste, e.g. with
unset zle_bracketed_paste
. Or disable ZVM instead - Paste the text again
- Observe that the text is pasted correctly
Expected behavior
ZVM is "bracketed paste aware" and handles the special sequences gracefully.