diff options
| -rw-r--r-- | atuin/src/command/client/search/interactive.rs | 2 | ||||
| -rw-r--r-- | atuin/src/shell/atuin.bash | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/atuin/src/command/client/search/interactive.rs b/atuin/src/command/client/search/interactive.rs index 167eb23a..3373d51b 100644 --- a/atuin/src/command/client/search/interactive.rs +++ b/atuin/src/command/client/search/interactive.rs @@ -705,7 +705,7 @@ pub async fn history( if index < results.len() { let mut command = results.swap_remove(index).command; - if accept && (utils::is_zsh() || utils::is_fish()) { + if accept && (utils::is_zsh() || utils::is_fish() || utils::is_bash()) { command = String::from("__atuin_accept__:") + &command; } diff --git a/atuin/src/shell/atuin.bash b/atuin/src/shell/atuin.bash index 3da296bb..bd9506e5 100644 --- a/atuin/src/shell/atuin.bash +++ b/atuin/src/shell/atuin.bash @@ -1,4 +1,5 @@ ATUIN_SESSION=$(atuin uuid) +ATUIN_STTY=$(stty -g) export ATUIN_SESSION __atuin_preexec() { @@ -53,8 +54,16 @@ __atuin_history() { # shellcheck disable=SC2154 __bp_set_ret_value "$preexec_ret_value" "$__bp_last_argument_prev_command" fi + # Juggle the terminal settings so that the command can be interacted with + local stty_backup + stty_backup=$(stty -g) + stty "$ATUIN_STTY" + eval "$HISTORY" exit_status=$? + + stty "$stty_backup" + # Execute preprompt commands __atuin_set_ret_value "$exit_status" "$HISTORY" eval "$PROMPT_COMMAND" |
