fix(bash/preexec): erase the prompt last line before Bash renders it

Fixes https://github.com/atuinsh/atuin/issues/1668

When the prompt becomes longer after "enter_accept", Bash still uses
the previous shorter prompt, so the extra characters in the new prompt
drawn by Atuin is left in the terminal display.  In this patch, we
remove the last line of the prompt drawn by Atuin so that it doesn't
interfere with the last line of the prompt drawn by Bash.
This commit is contained in:
Koichi Murase 2024-02-04 02:33:56 +09:00 committed by Ellie Huxtable
parent 374255dd58
commit b00887562b

View File

@ -158,7 +158,7 @@ __atuin_accept_line() {
# so to work for a multiline prompt we need to print it ourselves,
# then go to the beginning of the last line.
__atuin_evaluate_prompt
printf '%s\r' "$__atuin_prompt"
printf '%s\r%s' "$__atuin_prompt" "$(tput el)"
}
__atuin_history() {