Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bash): fix preexec of child Bash session started by enter_accept #2558

Merged
merged 1 commit into from
Jan 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions crates/atuin/src/shell/atuin.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading