zsh-autosuggestions icon indicating copy to clipboard operation
zsh-autosuggestions copied to clipboard

Failure to detect pasted content leads to wrongly continuing to suggest

Open PythonTryHard opened this issue 4 years ago • 2 comments

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.

  1. Write down any command that can lead to a suggestion. image
  2. Paste something in. The pasted content should be highlighted in white. Suggestion cannot be seen image
  3. Pressing should de-highlight the pasted content and reveal the suggestion still being there (when it supposedly shouldn't be) image Additionally, pressing or End should de-highlight and adding the suggestion to the end of the pasted content. image

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:

  1. Konsole 20.12.2
  2. kitty 0.19.3 (freshly out of the box)

On Ubuntu 20.10:

  1. GNOME Terminal 3.38.0

PythonTryHard avatar Feb 04 '21 12:02 PythonTryHard

have the same problem

lihk11 avatar Jun 19 '21 12:06 lihk11

This appears to be a duplicate of #351

ericfreese avatar Aug 26 '21 21:08 ericfreese