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.
Do this for 10 to 20 times:
$ source ~/.zshrc
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>
Most helpful comment
Sourcing
.zshrcisn't optimal in many ways and will break more than z-asug. Instead it's better to useexec zshto completely reinit from clean state.