Open akefirad opened 3 years ago
oof, this sounds like both a large added cost (especially if #2489’s fix ensures it is called once), and is also a breaking change for zsh users. Would the same apply to bash?
I'm not sure about bash TBH. Regarding the breaking change, yes, it kinda is, but not significant (it's not going to break any script or anything) IMHO. Up to you to decide, just wanted to let you know what I found.
@ljharb
I's very strange that I'm using zsh but load bash completion:
@tjx666 despite its name, it works for both bash and zsh.
Getting this error too despite my fpath:
15 fpath=(
16 /apollo/env/envImprovement/lib/zsh/${current_zsh_version}/zsh
17 /usr/share/zsh/${current_zsh_version}/functions
18 /usr/share/zsh-completions
19 /usr/share/zsh/site-functions
20 /usr/lib64/zsh/${current_zsh_version}/zsh
21 )
~ 22 echo "[INFO] Custom fpath is: $fpath"
+ 23
+ 24 # Backwards compatibility for a few things such as: nvm
+ 25 echo "[INFO] Loading bashcompinit and componit for ZSH"
+ 26 autoload -Uz compinit && compinit
+ 27 autoload -Uz bashcompinit && bashcompinit
This is an immediate followup on #2489. According to my finding (for example this by @marlonrichert),
compinit
andbashcompinit
should not be called in completion scripts, but users should be instructed to add it manually to their.zshrc
(if they have not done it already). The reason (as raised in the previous issue) is thatcompinit
(andbashcompinit
) must be called only once. Almost all completion scripts of real projects I found have done it this way (asking users to do it manually). Let me know what you think.