From 2d2f4b9ba92cfb55a5b9cdc3bf8fc3f1ff40e820 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 21 Feb 2022 22:54:10 +0530 Subject: [PATCH] Multi-line processing of bash prompts should only be done when the prompt actually contains a newline --- shell-integration/bash/kitty.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell-integration/bash/kitty.bash b/shell-integration/bash/kitty.bash index 5a20f31f3..cc1932cd6 100644 --- a/shell-integration/bash/kitty.bash +++ b/shell-integration/bash/kitty.bash @@ -52,7 +52,7 @@ _ksi_main() { if [[ -n "${_ksi_prompt[ps1]}" ]]; then PS1=${PS1//\\\[\\e\]133;k;start_kitty\\a\\\]*end_kitty\\a\\\]} PS1="${_ksi_prompt[ps1]}$PS1" - if [[ "${_ksi_prompt[mark]}" == "y" ]]; then + if [[ "${_ksi_prompt[mark]}" == "y" && "${PS1}" == *$'\n'* ]]; then # bash does not redraw the leading lines in a multiline prompt so # mark the last line as a secondary prompt. Otherwise on resize the # lines before the last line will be erased by kitty.