zsh-users / zsh-autosuggestions

Fish-like autosuggestions for zsh
MIT License
30.43k stars 1.85k forks source link

Autosuggestion triggered prematurely #664

Open Rhahkeem opened 2 years ago

Rhahkeem commented 2 years ago

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:

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

Additional context

Rhahkeem commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

antony-frolov commented 2 years ago

Got the same issue

jczhang02 commented 1 year ago

Same issue