Shell integration: Fix PS2 support
zsh only redraws the prompt from the last PS2 on a multiline prompt. Take this into account.
This commit is contained in:
parent
729cea88f3
commit
6d02ef59f8
@ -53,6 +53,7 @@
|
||||
if [[ "$_ksi_prompt[mark]" == "y" ]]; then _ksi_osc "133;$1"; fi
|
||||
}
|
||||
_ksi_prompt[start_mark]="%{$(_ksi_mark A)%}"
|
||||
_ksi_prompt[secondary_mark]="%{$(_ksi_mark 'A;k=s')%}"
|
||||
|
||||
function _ksi_set_title() {
|
||||
if [[ "$_ksi_prompt[title]" == "y" ]]; then _ksi_osc "2;$1"; fi
|
||||
@ -87,6 +88,9 @@
|
||||
# not called when the prompt is redrawn after a window resize or when a background
|
||||
# job finishes
|
||||
if [[ "$PS1" != *"$_ksi_prompt[start_mark]"* ]]; then PS1="$_ksi_prompt[start_mark]$PS1" fi
|
||||
# PS2 is used for prompt continuation. On resize with a continued prompt only the last
|
||||
# prompt is redrawn so we need to mark it
|
||||
if [[ "$PS2" != *"$_ksi_prompt[secondary_mark]"* ]]; then PS2="$_ksi_prompt[secondary_mark]$PS2" fi
|
||||
fi
|
||||
_ksi_prompt[state]="precmd"
|
||||
}
|
||||
@ -121,6 +125,7 @@
|
||||
_ksi_mark "C";
|
||||
# remove the prompt mark sequence while the command is executing as it could read/modify the value of PS1
|
||||
PS1="${PS1//$_ksi_prompt[start_mark]/}"
|
||||
PS2="${PS2//$_ksi_prompt[secondary_mark]/}"
|
||||
fi
|
||||
# Set kitty window title to the currently executing command
|
||||
_ksi_set_title "$1"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user