Shell integration: Better fix for multi-line prompts in bash

Also fix bash redrawing only the last PS2 prompt
This commit is contained in:
Kovid Goyal 2021-10-22 12:19:03 +05:30
parent 18aca275c8
commit 0f9944190d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -40,7 +40,12 @@ _ksi_main() {
fi
if [[ "${_ksi_prompt[mark]}" == "y" ]]; then
PS1="\[\e]133;A;does_not_redraw_multiline_prompt\a\]$PS1"
# 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"}
PS1="\[\e]133;A\a\]$PS1"
PS2="\[\e]133;A;k=s\a\]$PS2"
PS0="\[\e]133;C\a\]$PS0"
fi