From aa556fa0883d1a5c8f35960c9d6e8966e4307896 Mon Sep 17 00:00:00 2001 From: Jamie Quigley Date: Tue, 23 Aug 2022 17:26:42 +0100 Subject: Fix atuin crashing on commands that start with -- (#509) The use of `--` in the shell scripts prevents clap attempting to parse the command name as a flag, in the case that it starts with `--`. --- src/shell/atuin.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/shell/atuin.bash') diff --git a/src/shell/atuin.bash b/src/shell/atuin.bash index 3d86497b..4530e31e 100644 --- a/src/shell/atuin.bash +++ b/src/shell/atuin.bash @@ -2,7 +2,7 @@ ATUIN_SESSION=$(atuin uuid) export ATUIN_SESSION _atuin_preexec() { - local id; id=$(atuin history start "$1") + local id; id=$(atuin history start -- "$1") export ATUIN_HISTORY_ID="${id}" } @@ -11,13 +11,13 @@ _atuin_precmd() { [[ -z "${ATUIN_HISTORY_ID}" ]] && return - (RUST_LOG=error atuin history end "${ATUIN_HISTORY_ID}" --exit "${EXIT}" &) > /dev/null 2>&1 + (RUST_LOG=error atuin history end --exit "${EXIT}" -- "${ATUIN_HISTORY_ID}" &) > /dev/null 2>&1 } __atuin_history () { tput rmkx - HISTORY="$(RUST_LOG=error atuin search -i "${READLINE_LINE}" 3>&1 1>&2 2>&3)" + HISTORY="$(RUST_LOG=error atuin search -i -- "${READLINE_LINE}" 3>&1 1>&2 2>&3)" tput smkx READLINE_LINE=${HISTORY} -- cgit v1.3.1