zsh-autosuggestions
zsh-autosuggestions copied to clipboard
Failure to detect pasted content leads to wrongly continuing to suggest
Describe the bug
As an oh-my-zsh
plugin, zsh-autosuggestions
fails to detect if something has been pasted and will continue to suggest until such pasted content is modified (adding/removing a character)
To Reproduce (with Screenshots)
Note: All screenshots are obtained with the minimal .zshrc
attached below.
- Write down any command that can lead to a suggestion.
- Paste something in. The pasted content should be highlighted in white. Suggestion cannot be seen
- Pressing ← should de-highlight the pasted content and reveal the suggestion still being there (when it supposedly shouldn't be)
Additionally, pressing → or End should de-highlight and adding the suggestion to the end of the pasted content.
Expected behavior
After pressing ←, there should be no suggestion, and pressing → or End should not result in the suggestion getting added to the end.
Desktop
- OS + distribution: KDE neon Testing Edition 5.21, and Ubuntu 20.10 (both are fully up-to-date as of writing this report)
- Zsh version:
5.8
- Plugin version:
ae315ded4dba10685dbbafbfa2ff3c1aefeb490d
Additional context
Minimal .zshrc
that can trigger this bug
Irreproducible locally with zsh -df
followed by manual sourcing due to suggestion not appearing, however reproducible with the following minimal .zshrc
export ZSH="/home/f4ll3n53r4ph/.oh-my-zsh"
plugins=(zsh-autosuggestions)
source $ZSH/oh-my-zsh.sh
Terminal tested against
On KDE neon:
- Konsole 20.12.2
-
kitty
0.19.3 (freshly out of the box)
On Ubuntu 20.10:
- GNOME Terminal 3.38.0
have the same problem
This appears to be a duplicate of #351