diff options
| author | Jamie Quigley <jamie@quigley.xyz> | 2022-12-24 17:18:44 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-24 17:18:44 +0000 |
| commit | a5616aea8fa28db6f8f7b1a44e28f90aab3363b7 (patch) | |
| tree | e4669336601c6f7a6f14dc980493800f98dd0014 /src/shell/atuin.bash | |
| parent | Allow overriding filter and search modes from CLI (#635) (diff) | |
| download | atuin-a5616aea8fa28db6f8f7b1a44e28f90aab3363b7.zip | |
Rework `atuin init` (#652)
* Rework `atuin init`
This allows users to disable the CTRL-R and Up Arrow bindings,
independently from one another
* Document --disable-{ctrl-r,up-arrow}
* Apply suggestions from code review
Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
Diffstat (limited to '')
| -rw-r--r-- | src/shell/atuin.bash | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/shell/atuin.bash b/src/shell/atuin.bash index 9c8fa237..1056dcf5 100644 --- a/src/shell/atuin.bash +++ b/src/shell/atuin.bash @@ -2,7 +2,8 @@ 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,11 +12,10 @@ _atuin_precmd() { [[ -z "${ATUIN_HISTORY_ID}" ]] && return - (RUST_LOG=error atuin history end --exit "${EXIT}" -- "${ATUIN_HISTORY_ID}" &) > /dev/null 2>&1 + (RUST_LOG=error atuin history end --exit "${EXIT}" -- "${ATUIN_HISTORY_ID}" &) >/dev/null 2>&1 } -__atuin_history () -{ +__atuin_history() { tput rmkx # shellcheck disable=SC2048,SC2086 HISTORY="$(RUST_LOG=error atuin search $* -i -- "${READLINE_LINE}" 3>&1 1>&2 2>&3)" @@ -32,9 +32,3 @@ else precmd_functions+=(_atuin_precmd) preexec_functions+=(_atuin_preexec) fi - -if [[ -z ${ATUIN_NOBIND} ]]; then - bind -x '"\C-r": __atuin_history' - bind -x '"\e[A": __atuin_history --shell-up-key-binding' - bind -x '"\eOA": __atuin_history --shell-up-key-binding' -fi |
