fix(zsh): zsh_autosuggest_strategy for no-unset environment (#1486)

* fix for zsh no-unset environments

* fix zsh_autosuggest_strategy for no-unset environment
This commit is contained in:
DS/Charlie 2024-01-02 12:53:18 +01:00 committed by GitHub
parent 34baad290c
commit f44db9d7f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,12 @@ zmodload zsh/datetime 2>/dev/null
_zsh_autosuggest_strategy_atuin() {
suggestion=$(atuin search --cmd-only --limit 1 --search-mode prefix "$1")
}
ZSH_AUTOSUGGEST_STRATEGY=("atuin" "${ZSH_AUTOSUGGEST_STRATEGY[@]}")
if [ -n "${ZSH_AUTOSUGGEST_STRATEGY:-}" ]; then
ZSH_AUTOSUGGEST_STRATEGY=("atuin" "${ZSH_AUTOSUGGEST_STRATEGY[@]}")
else
ZSH_AUTOSUGGEST_STRATEGY=("atuin")
fi
export ATUIN_SESSION=$(atuin uuid)