Add a note about why we check _ksi_prompt_command

This commit is contained in:
Kovid Goyal 2022-02-08 19:52:02 +05:30
parent 7457f637a2
commit dc6138d286
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -135,7 +135,9 @@ _ksi_main() {
builtin unset _ksi_prompt[end_secondary_mark] builtin unset _ksi_prompt[end_secondary_mark]
# install our prompt command, using an array if it is unset or already an array, # install our prompt command, using an array if it is unset or already an array,
# otherwise append a string # otherwise append a string. We check if _ksi_prompt_command exists as some shell
# scripts stupidly export PROMPT_COMMAND making it inherited by all programs launched
# from the shell
builtin local pc='builtin declare -F _ksi_prompt_command > /dev/null 2> /dev/null && _ksi_prompt_command' builtin local pc='builtin declare -F _ksi_prompt_command > /dev/null 2> /dev/null && _ksi_prompt_command'
if [[ -z "${PROMPT_COMMAND}" ]]; then if [[ -z "${PROMPT_COMMAND}" ]]; then
PROMPT_COMMAND=([0]="$pc") PROMPT_COMMAND=([0]="$pc")