fix(MacOS): zsh subprocess uses 100% CPU

This commit is contained in:
2026-05-27 10:40:19 +08:00
parent 4a912cf7e7
commit ed6dadd5eb
+6 -10
View File
@@ -7,10 +7,6 @@ if [ ! -n "${ZSH_VERSION}" ]; then
return 1
fi
if [ $+commands[nu] ]; then
exec nu
fi
# get the dir name that current file in
function get_current_dir_name {
_source="${(%):-%x}"
@@ -46,21 +42,21 @@ done
unset _file
# Load Plugins
if [[ -f $ZSH_POLYJUICE_PLUGINS_PATH/zsh-autocomplete/zsh-autocomplete.plugin.zsh ]]; then
source $ZSH_POLYJUICE_PLUGINS_PATH/zsh-autocomplete/zsh-autocomplete.plugin.zsh
fi
if [[ -f $ZSH_POLYJUICE_PLUGINS_PATH/fzf-tab/fzf-tab.plugin.zsh ]]; then
source $ZSH_POLYJUICE_PLUGINS_PATH/fzf-tab/fzf-tab.plugin.zsh # should load before autosuggestions/syntax-highlighting
fi
if [[ -f $ZSH_POLYJUICE_PLUGINS_PATH/zsh-autosuggestions/zsh-autosuggestions.zsh ]]; then
source $ZSH_POLYJUICE_PLUGINS_PATH/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh
ZSH_AUTOSUGGEST_STRATEGY=(history completion)
ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20
bindkey '^[l' autosuggest-accept # alt-L to accept autosuggestion
fi
if [[ -f $ZSH_POLYJUICE_PLUGINS_PATH/zsh-autocomplete/zsh-autocomplete.plugin.zsh ]]; then
source $ZSH_POLYJUICE_PLUGINS_PATH/zsh-autocomplete/zsh-autocomplete.plugin.zsh
fi
if [[ -f $ZSH_POLYJUICE_PLUGINS_PATH/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh ]]; then
source $ZSH_POLYJUICE_PLUGINS_PATH/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh
fi
if [[ -f $ZSH_POLYJUICE_PLUGINS_PATH/fzf-tab/fzf-tab.plugin.zsh ]]; then
source $ZSH_POLYJUICE_PLUGINS_PATH/fzf-tab/fzf-tab.plugin.zsh # relies on fzf itself and zsh-autocomplete plugin
fi
# using starship as prompt
if (( $+commands[starship] )); then