fix(MacOS): async problems

This commit is contained in:
2026-05-27 16:13:41 +08:00
parent ed6dadd5eb
commit 8b36c0019f
+27
View File
@@ -41,6 +41,31 @@ for _file in "$ZSH_POLYJUICE_FUNCTIONS_PATH"/*.sh; do
done
unset _file
# macOS configuration
if [[ $OS == "Darwin" ]]; then
# Load Plugins
if [[ -f $ZSH_POLYJUICE_PLUGINS_PATH/zsh-autocomplete/zsh-autocomplete.plugin.zsh ]]; then
zstyle ':autocomplete:async' enabled no
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-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/zsh-autosuggestions/zsh-autosuggestions.zsh ]]; then
ZSH_AUTOSUGGEST_STRATEGY=(history)
ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20
ZSH_AUTOSUGGEST_MANUAL_REBIND=1
source $ZSH_POLYJUICE_PLUGINS_PATH/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh
unset ZSH_AUTOSUGGEST_USE_ASYNC
_zsh_autosuggest_bind_widgets
bindkey '^[l' autosuggest-accept # alt-L to accept autosuggestion
fi
else
# 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
@@ -58,6 +83,8 @@ if [[ -f $ZSH_POLYJUICE_PLUGINS_PATH/zsh-syntax-highlighting/zsh-syntax-highligh
source $ZSH_POLYJUICE_PLUGINS_PATH/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh
fi
fi
# using starship as prompt
if (( $+commands[starship] )); then
export STARSHIP_CONFIG="$ZSH_POLYJUICE_STARSHIP_CONFIG_FILE"