zsh-autocomplete: Unable to execute command first time if I type too fast.
I’m not 100% certain this is a bug with this plugin, however, even though I’m not able to reproduce it by running zsh -df
, however, I am able to reproduce it with zsh-autocomplete
being the only thing that is being sourced in my .zshrc
.
EDIT: Done some more testing, pretty convinced this is an zsh-autocomplete
issue, I think the reason I can’t reproduce it with zsh -df
is because the plugin unhindered by memory usage issues that don’t exist when running zsh with zsh -df
, so the delay is small enough that I can’t type fast enough to reproduce the issue.
EDIT: One discovery I’ve just made is that if I press option-enter/ ⌥↩
instead of just enter, the issue never occurs.
Describe the bug
There is a period of time, perhaps 300ms, where hitting enter on a command results in iTerm2 emitting an alert and failing to execute the command. Certain commands that I tend to type quickly like g co master
often require me to hit enter twice to execute them. This occurs regardless of whether aliases are being used.
The autocomplete suggestions are visible when this occurs.
I will continue to try to debug this.
To Reproduce
Find a command that you can type fast, type the command and hit enter fast enough to receive an error.
I’m not able to reproduce it by running zsh -df
, however, I am able to reproduce it with zsh-autocomplete
being the only thing that is being sourced in my .zshrc
.
Expected behavior
Hit enter on command and it executes
Actual behavior
Hit enter on a command and it sometimes doesn’t execute
Desktop
- OS + distribution: macOS Catalina
- Zsh version: 5.8
- Plugin version: 3c7e78daf32f19d3091c088d041942c545d208f1
Additional context
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 32 (14 by maintainers)
Thanks for this awesome plugin!
Great to hear you managed to solve it! 👏🏽🥳
I just recreated my
.zshrc
from scratch one config at a time but this time I usedzinit
instead ofzplug
and the issue has completely gone away.My shell is noticeably snappier after switching to
zinit
, so I’m putting this down to my previous shell config leading to too much stuff being stored in memory which caused delays between functions. Or something to that effect.Thanks for looking into this. I’m not gonna keep this issue open because getting rid of
zplug
seems to have fixed it.Sent with GitHawk
By not executing, I mean that I can’t submit the prompt so to speak, so yes I am on the same prompt.
When you see the bell on screen, that’s when I press enter the first time, and iTerm is not executing the command and making an error sound. Then I press enter again and the command executes creating a new prompt.