mirror of
https://github.com/atuinsh/atuin.git
synced 2025-03-03 01:32:17 +01:00
Revert "Revert "fix(bash): avoid unexpected atuin history start
for keybind…" (#1728)
This reverts commit 032ca19c73
.
This commit is contained in:
parent
032ca19c73
commit
07f363ba3a
@ -17,6 +17,14 @@ export ATUIN_SESSION
|
||||
ATUIN_HISTORY_ID=""
|
||||
|
||||
__atuin_preexec() {
|
||||
if [[ ! ${BLE_ATTACHED-} ]]; then
|
||||
# With bash-preexec, preexec may be called even for the command run by
|
||||
# keybindings. There is no general and robust way to detect the
|
||||
# command for keybindings, but at least we want to exclude Atuin's
|
||||
# keybindings.
|
||||
[[ $BASH_COMMAND == '__atuin_history'* && $BASH_COMMAND != "$1" ]] && return 0
|
||||
fi
|
||||
|
||||
local id
|
||||
id=$(atuin history start -- "$1")
|
||||
export ATUIN_HISTORY_ID=$id
|
||||
|
Loading…
Reference in New Issue
Block a user