Zsh-autosuggestions: Prompt is slow after multiple "source ~/.zshrc"

Created on 15 Sep 2019  路  5Comments  路  Source: zsh-users/zsh-autosuggestions

Describe the bug

zsh prompt becomes very slow after multiple times of "source ~/.zshrc". I suspect it's the widgets of "_zsh_autosuggest_bound_#n_*" slowing zsh down, because after every time I do "source ~/.zshrc" the number of these widgets increases. For example when a new shell starts only widgets of "_zsh_autosuggest_bound_1_*" are registered, and after a second "source ~/.zshrc" widgets of "_zsh_autosuggest_bound_2_*" are added.
I use oh-my-zsh to load this plugin.

To Reproduce

Do this for 10 to 20 times:

$ source ~/.zshrc

Desktop

  • OS + distribution: debian
  • Zsh version: 5.7
  • Plugin version: 43f3bc40
has-workaround performance

Most helpful comment

Sourcing .zshrc isn't optimal in many ways and will break more than z-asug. Instead it's better to use exec zsh to completely reinit from clean state.

All 5 comments

I could see this being an issue but will probably be low priority for me to fix since the issue is avoidable by not re-sourcing zshrc many times.

You're right! It's not really a issue for normal users. I only encounter this issue because I'm testing with different .zshrc configurations thus sourcing .zshrc multiple times.

Sourcing .zshrc isn't optimal in many ways and will break more than z-asug. Instead it's better to use exec zsh to completely reinit from clean state.

@silverneko How do you check the list of all widgets?

zle -l or if you have auto completion then _<tab>

Was this page helpful?
0 / 5 - 0 ratings

Related issues

daniele-orlando picture daniele-orlando  路  6Comments

NikKovIos picture NikKovIos  路  4Comments

OmeGak picture OmeGak  路  3Comments

dipam7 picture dipam7  路  3Comments

metalmac picture metalmac  路  4Comments