aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKoichi Murase <myoga.murase@gmail.com>2024-02-04 02:33:56 +0900
committerEllie Huxtable <ellie@elliehuxtable.com>2024-02-03 23:49:14 +0100
commitb00887562b82d060aea71acebf18fd51891a211d (patch)
treedb70cfeee4b383108d25f2f97a5d10ca2fe2ba71
parentfeat: add `store pull` (diff)
downloadatuin-b00887562b82d060aea71acebf18fd51891a211d.zip
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.
-rw-r--r--atuin/src/shell/atuin.bash2
1 files changed, 1 insertions, 1 deletions
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() {