Multi-line processing of bash prompts should only be done when the prompt actually contains a newline

This commit is contained in:
Kovid Goyal 2022-02-21 22:54:10 +05:30
parent 65c7ecbc30
commit 2d2f4b9ba9
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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.