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

Autosuggestion triggered prematurely

Open Rhahkeem opened this issue 2 years ago • 6 comments

Describe the bug

when selecting something from the autcomplete, subsequent suggestions are shown prematurely.

I attached a screenshot showing this behaviour when compared to fish

To Reproduce

Steps to reproduce the behavior:

  • make a new directory
  • add a file in there example.txt
  • in the shell , navigate to the new dieectory and type less exam
  • hit tab

note that file is completed, but then there's a second suggestion for example.txt again. In fish this doesnt, happen

Expected behavior

I expect that the suggestion I picked is chosen (but not executed) and there are no more suggestions until I start typing something more. similar to fish shell. Right now it's shown even when I haven't typed anything more

Screenshots

Fish vs Autosuggestion

Desktop

  • OS + distribution: Distributor ID: Ubuntu Description: Ubuntu 20.04.4 LTS Release: 20.04 Codename: focal

  • Zsh version: 5.8

  • Plugin version: commit a411ef3e0992d4839f0732ebeb9823024afaaaa8

Additional context

Rhahkeem avatar Feb 28 '22 14:02 Rhahkeem

Looks related to #656 and #658 actually. The behaviour is different with tab in these scenarios. Ie the way tab works fish is how right arrow works here.

Rhahkeem avatar Feb 28 '22 19:02 Rhahkeem

image

i also get this when I type echo $HISTSIZE. Note how it triggers a suggestion immediately, without having any space, making this impossible to use for history

Rhahkeem avatar Mar 05 '22 21:03 Rhahkeem

think it's also related to this https://github.com/zsh-users/zsh-autosuggestions/issues/525, the suggestions is triggered on an empty buffer (ie whitespace )

Rhahkeem avatar Mar 07 '22 19:03 Rhahkeem

if anyone is curious how to fix this:

https://github.com/zsh-users/zsh-autosuggestions/compare/master...Rhahkeem:whitespace?expand=1

shows the change I made

Rhahkeem avatar Mar 08 '22 22:03 Rhahkeem

Got the same issue

antony-frolov avatar Jul 09 '22 07:07 antony-frolov

Same issue

jczhang02 avatar Aug 22 '22 06:08 jczhang02