From b00887562b82d060aea71acebf18fd51891a211d Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sun, 4 Feb 2024 02:33:56 +0900 Subject: 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. --- atuin/src/shell/atuin.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atuin/src/shell/atuin.bash b/atuin/src/shell/atuin.bash index 5feb6d12..5b6a8dec 100644 --- a/atuin/src/shell/atuin.bash +++ b/atuin/src/shell/atuin.bash @@ -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() { -- cgit v1.3.1