Skip to content
Open
Changes from 1 commit
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
6 changes: 5 additions & 1 deletion 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() {
if [[ -o nosharehistory ]]; then
filter_mode='--filter-mode session'
fi

# 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)
suggestion=$(ATUIN_QUERY="$1" atuin search --cmd-only --limit 1 --search-mode prefix "$filter_mode" 2>/dev/null)
}

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