diff options
| author | Koichi Murase <myoga.murase@gmail.com> | 2025-01-23 10:00:58 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-23 01:00:58 +0000 |
| commit | d63f7df14d58c53b9aaec1bf2b67af031610572c (patch) | |
| tree | 61b6bbc90a923309916930bfd8dd97e8e10fc2f7 | |
| parent | chore(deps): bump the cargo group with 2 updates (#2480) (diff) | |
| download | atuin-d63f7df14d58c53b9aaec1bf2b67af031610572c.zip | |
fix(bash): fix preexec of child Bash session started by enter_accept (#2558)
| -rw-r--r-- | crates/atuin/src/shell/atuin.bash | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/atuin/src/shell/atuin.bash b/crates/atuin/src/shell/atuin.bash index 2a7081e0..cd5a8eff 100644 --- a/crates/atuin/src/shell/atuin.bash +++ b/crates/atuin/src/shell/atuin.bash @@ -189,6 +189,14 @@ __atuin_accept_line() { # If extdebug is turned on and any preexec function returns non-zero # exit status, we do not run the user command. if ! { shopt -q extdebug && ((__atuin_preexec_ret_value)); }; then + # Note: When a child Bash session is started by enter_accept, if the + # environment variable READLINE_POINT is present, bash-preexec in the + # child session does not fire preexec at all because it considers we + # are inside Atuin's keybinding of the current session. To avoid + # propagating the environment variable to the child session, we remove + # the export attribute of READLINE_LINE and READLINE_POINT. + export -n READLINE_LINE READLINE_POINT + # Juggle the terminal settings so that the command can be interacted # with local __atuin_stty_backup |
