mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-27 03:42:49 +00:00
bash shell integration: Dont call _ksi_prompt_command from PROMPT_COMMAND unlessit is set
This commit is contained in:
parent
c9da734c0e
commit
7457f637a2
1 changed files with 4 additions and 3 deletions
|
|
@ -136,14 +136,15 @@ _ksi_main() {
|
|||
|
||||
# install our prompt command, using an array if it is unset or already an array,
|
||||
# otherwise append a string
|
||||
builtin local pc='builtin declare -F _ksi_prompt_command > /dev/null 2> /dev/null && _ksi_prompt_command'
|
||||
if [[ -z "${PROMPT_COMMAND}" ]]; then
|
||||
PROMPT_COMMAND=([0]="_ksi_prompt_command")
|
||||
PROMPT_COMMAND=([0]="$pc")
|
||||
elif [[ $(builtin declare -p PROMPT_COMMAND 2> /dev/null) =~ 'declare -a PROMPT_COMMAND' ]]; then
|
||||
PROMPT_COMMAND+=("_ksi_prompt_command")
|
||||
PROMPT_COMMAND+=("$pc")
|
||||
else
|
||||
PROMPT_COMMAND="${PROMPT_COMMAND%% }"
|
||||
PROMPT_COMMAND="${PROMPT_COMMAND%%;}"
|
||||
PROMPT_COMMAND+="; _ksi_prompt_command"
|
||||
PROMPT_COMMAND+="; $pc"
|
||||
fi
|
||||
}
|
||||
_ksi_main
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue