zsh-users / zsh-autosuggestions

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

The `completion` strategy prohibitively slow when fetching from network #597

Closed mareq closed 3 years ago

mareq commented 3 years ago

Describe the bug

When the completion strategy needs to fetch information from network, the command prompt freezes.

To Reproduce

Steps to reproduce the behavior: type any command that would attempt completion using some information from network, e.g.:

Note: COMPLETION_WAITING_DOTS="true" was set whole time; the dots are not displayed.

Expected behavior

Ideally, fetch information from network asynchronously on background (is the COMPLETION_WAITING_DOTS="true" setting meant for this and this means that it does not work as it shoud?).

Additionally, provide setting to disable any network traffic originating from the plugin (this may be a useful feature on itself, regardless of this issue).

Screenshots

N/A

Desktop

Additional context

N/A

ericfreese commented 3 years ago

Hi, please give the async mode a try

It will be enabled by default in the next release

https://github.com/zsh-users/zsh-autosuggestions#enable-asynchronous-mode

mareq commented 3 years ago

Yes, ZSH_AUTOSUGGEST_USE_ASYNC="true" in .zshrc pretty much fixes the problem. I did not know about that option, thank you!

Note: It still would be a nice feature to be able to suppress all network traffic, but that is separate thing and rated only as nice-to-have new feature -> Closing this ticket.