From ed394afa82ef919937521e5ce72fc467cec203f9 Mon Sep 17 00:00:00 2001 From: Patrick Decat Date: Sun, 18 Dec 2022 19:26:09 +0100 Subject: Allow overriding filter and search modes from CLI (#635) * Allow overriding filter and search modes from CLI arguments * Use session filter mode for bash up key binding * We precisely do not want to add quotes here so that all arguments are properly passed * Add --shell-up-key-binding hidden command argument and filter_mode_shell_up_key_binding configuration option to allow customizing the filter mode used when atuin is invoked from a shell up-key binding * Correct up binding for zsh Co-authored-by: Ellie Huxtable --- src/shell/atuin.bash | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/shell/atuin.bash') diff --git a/src/shell/atuin.bash b/src/shell/atuin.bash index 4530e31e..9c8fa237 100644 --- a/src/shell/atuin.bash +++ b/src/shell/atuin.bash @@ -17,7 +17,8 @@ _atuin_precmd() { __atuin_history () { tput rmkx - HISTORY="$(RUST_LOG=error atuin search -i -- "${READLINE_LINE}" 3>&1 1>&2 2>&3)" + # shellcheck disable=SC2048,SC2086 + HISTORY="$(RUST_LOG=error atuin search $* -i -- "${READLINE_LINE}" 3>&1 1>&2 2>&3)" tput smkx READLINE_LINE=${HISTORY} @@ -34,6 +35,6 @@ fi if [[ -z ${ATUIN_NOBIND} ]]; then bind -x '"\C-r": __atuin_history' - bind -x '"\e[A": __atuin_history' - bind -x '"\eOA": __atuin_history' + bind -x '"\e[A": __atuin_history --shell-up-key-binding' + bind -x '"\eOA": __atuin_history --shell-up-key-binding' fi -- cgit v1.3.1