a4a224b3fe4c945bb28e6d96b46dc2d300748123
- Author
- farlyfeifei <farlyfeifei@163.com>
- Committer
- GitHub <noreply@github.com>
- Date
Message
perf: avoid duplicate completion security audit (#13873)
Diff
1diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
2index 3e547d3583d17a870e228bad2f9f3bf86eb9e2de..b4e95e0ff29edf0385ac3a34e8033c5c007625fe 100644
3--- a/oh-my-zsh.sh
4+++ b/oh-my-zsh.sh
5@@ -124,9 +124,11 @@ fi
6 if [[ "$ZSH_DISABLE_COMPFIX" != true ]]; then
7 source "$ZSH/lib/compfix.zsh"
8 # Load only from secure directories
9+ # Reset the flag compinit sets when -i excludes insecure entries
10+ unset _comp_secure
11 compinit -i -d "$ZSH_COMPDUMP"
12 # If completion insecurities exist, warn the user
13- handle_completion_insecurities &|
14+ [[ "$_comp_secure" == yes ]] && handle_completion_insecurities &|
15 else
16 # If the user wants it, load from all found directories
17 compinit -u -d "$ZSH_COMPDUMP"