mirror of
https://github.com/atuinsh/atuin.git
synced 2025-06-26 04:41:27 +02:00
fix(shell): fix incorrect timing of child shells (#1510)
When a child shell session is started from another shell session (parent session), the environment variable ATUIN_HISTORY_ID set by the parent session causes Atuin's precmd hook of the child session to be unexpectedly performed before the first call of Atuin's preexec hook. In this patch, we clear ATUIN_HISTORY_ID (possibly set by the parent session) on the startup of the session.
This commit is contained in:
parent
7e48768ddf
commit
cc5efd2971
@ -1,6 +1,7 @@
|
|||||||
ATUIN_SESSION=$(atuin uuid)
|
ATUIN_SESSION=$(atuin uuid)
|
||||||
ATUIN_STTY=$(stty -g)
|
ATUIN_STTY=$(stty -g)
|
||||||
export ATUIN_SESSION
|
export ATUIN_SESSION
|
||||||
|
ATUIN_HISTORY_ID=""
|
||||||
|
|
||||||
__atuin_preexec() {
|
__atuin_preexec() {
|
||||||
if [[ ! ${BLE_ATTACHED-} ]]; then
|
if [[ ! ${BLE_ATTACHED-} ]]; then
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
set -gx ATUIN_SESSION (atuin uuid)
|
set -gx ATUIN_SESSION (atuin uuid)
|
||||||
|
set --erase ATUIN_HISTORY_ID
|
||||||
|
|
||||||
function _atuin_preexec --on-event fish_preexec
|
function _atuin_preexec --on-event fish_preexec
|
||||||
if not test -n "$fish_private_mode"
|
if not test -n "$fish_private_mode"
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# Source this in your ~/.config/nushell/config.nu
|
# Source this in your ~/.config/nushell/config.nu
|
||||||
$env.ATUIN_SESSION = (atuin uuid)
|
$env.ATUIN_SESSION = (atuin uuid)
|
||||||
|
hide-env -i ATUIN_HISTORY_ID
|
||||||
|
|
||||||
# Magic token to make sure we don't record commands run by keybindings
|
# Magic token to make sure we don't record commands run by keybindings
|
||||||
let ATUIN_KEYBINDING_TOKEN = $"# (random uuid)"
|
let ATUIN_KEYBINDING_TOKEN = $"# (random uuid)"
|
||||||
|
@ -25,6 +25,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
export ATUIN_SESSION=$(atuin uuid)
|
export ATUIN_SESSION=$(atuin uuid)
|
||||||
|
ATUIN_HISTORY_ID=""
|
||||||
|
|
||||||
_atuin_preexec() {
|
_atuin_preexec() {
|
||||||
local id
|
local id
|
||||||
|
Loading…
x
Reference in New Issue
Block a user