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.
General information
Basic examination
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
Hello World
Hello WorlD
and that you are in normal modeunset zle_bracketed_paste
. Or disable ZVM insteadExpected behavior
ZVM is "bracketed paste aware" and handles the special sequences gracefully.