diff options
author | DS/Charlie <82801887+ds-cbo@users.noreply.github.com> | 2024-01-02 12:53:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-02 11:53:18 +0000 |
commit | f44db9d7f90a268f245e705701c2968fa6092030 (patch) | |
tree | 55c3e80f681badbb507ccaf30efdcc10e5a72330 | |
parent | 34baad290c2340df1b8da536114ba15c96e97172 (diff) |
fix(zsh): zsh_autosuggest_strategy for no-unset environment (#1486)
* fix for zsh no-unset environments
* fix zsh_autosuggest_strategy for no-unset environment
-rw-r--r-- | atuin/src/shell/atuin.zsh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/atuin/src/shell/atuin.zsh b/atuin/src/shell/atuin.zsh index 16c001c4..430067b2 100644 --- a/atuin/src/shell/atuin.zsh +++ b/atuin/src/shell/atuin.zsh @@ -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) |