Bash integration: Handle existing PROMPT_COMMAND ending with a literal newline

This commit is contained in:
Kovid Goyal 2022-03-30 10:44:59 +05:30
parent 5c03a52a0b
commit 5641668bc1
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 1 deletions

View File

@ -53,6 +53,8 @@ Detailed list of changes
- Bash integration: Prevent shell integration code from running twice if user enables both automatic and manual integration
- Bash integration: Handle existing PROMPT_COMMAND ending with a literal newline
- Fix continued lines not having their continued status reset on line feed (:iss:`4837`)
- macOS: Allow the New kitty Tab/Window Here services to open multiple selected folders. (:pull:`4848`)

View File

@ -251,7 +251,7 @@ _ksi_main() {
elif [[ $(builtin declare -p PROMPT_COMMAND 2> /dev/null) =~ 'declare -a PROMPT_COMMAND' ]]; then
PROMPT_COMMAND+=("$pc")
else
PROMPT_COMMAND="${PROMPT_COMMAND%% }"
PROMPT_COMMAND="${PROMPT_COMMAND%%[[:space:]]}"
PROMPT_COMMAND="${PROMPT_COMMAND%%;}"
PROMPT_COMMAND+="; $pc"
fi