aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Jackson <patrick@jackson.dev>2023-12-05 09:56:47 -0800
committerGitHub <noreply@github.com>2023-12-05 17:56:47 +0000
commita52568be795b891c96438ec116ce0b29723655e7 (patch)
tree7fb03600630cfc4d5974f5413cdf7c25492c18c9
parentchore: update rusty_paseto and rusty_paserk (#1420) (diff)
downloadatuin-a52568be795b891c96438ec116ce0b29723655e7.zip
fix: reenable enter_accept for bash (#1408)
* fix: reenable enter_accept for bash * fix: Fix the shellcheck warnings
-rw-r--r--atuin/src/command/client/search/interactive.rs2
-rw-r--r--atuin/src/shell/atuin.bash9
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"