mirror of
https://github.com/atuinsh/atuin.git
synced 2025-01-27 00:29:42 +01:00
fix: reenable enter_accept for bash (#1408)
* fix: reenable enter_accept for bash * fix: Fix the shellcheck warnings
This commit is contained in:
parent
839965a8d7
commit
a52568be79
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user