From 899b5078ebc0bd12a4958527f51633c833534a17 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 23 Oct 2021 18:48:45 +0530 Subject: [PATCH] bash integration: fix newline replace in PS1 --- shell-integration/kitty.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shell-integration/kitty.bash b/shell-integration/kitty.bash index 29aaff5fb..cf32ee97b 100644 --- a/shell-integration/kitty.bash +++ b/shell-integration/kitty.bash @@ -42,8 +42,8 @@ _ksi_main() { if [[ "${_ksi_prompt[mark]}" == "y" ]]; then # bash does not redraw the leading lines in a multiline prompt so # mark them as secondary prompts - local secondary_prompt="\[\e]133;A;k=s\a\]" - PS1=${PS1//\n/\n"$secondary_prompt"} + local secondary_prompt="\n\[\e]133;A;k=s\a\]" + PS1=${PS1//"\n"/"$secondary_prompt"} PS1="\[\e]133;A\a\]$PS1" PS2="\[\e]133;A;k=s\a\]$PS2" PS0="\[\e]133;C\a\]$PS0"