Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions crates/atuin/src/shell/atuin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ zmodload zsh/datetime 2>/dev/null
# you'd like to override this, then add your config after the $(atuin init zsh)
# in your .zshrc
_zsh_autosuggest_strategy_atuin() {
# silence errors, since we don't want to spam the terminal prompt while typing.
suggestion=$(ATUIN_QUERY="$1" atuin search --cmd-only --limit 1 --search-mode prefix 2>/dev/null)
if [[ -o nosharehistory ]]; then
# silence errors, since we don't want to spam the terminal prompt while typing.
suggestion=$(ATUIN_QUERY="$1" atuin search --cmd-only --limit 1 --search-mode prefix --filter-mode session 2>/dev/null)
else
suggestion=$(ATUIN_QUERY="$1" atuin search --cmd-only --limit 1 --search-mode prefix 2>/dev/null)
fi
}

if [ -n "${ZSH_AUTOSUGGEST_STRATEGY:-}" ]; then
Expand Down