File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ __bp_set_ret_value() {
159159__bp_in_prompt_command () {
160160
161161 local prompt_command_array
162- IFS=$' \n ;' read -rd ' ' -a prompt_command_array <<< " $PROMPT_COMMAND"
162+ IFS=$' \n ;' read -rd ' ' -a prompt_command_array <<< " ${ PROMPT_COMMAND:-} "
163163
164164 local trimmed_arg
165165 __bp_trim_whitespace trimmed_arg " ${1:- } "
@@ -297,7 +297,8 @@ __bp_install() {
297297
298298 local existing_prompt_command
299299 # Remove setting our trap install string and sanitize the existing prompt command string
300- existing_prompt_command=" ${PROMPT_COMMAND// $__bp_install_string [;$'\n']} " # Edge case of appending to PROMPT_COMMAND
300+ existing_prompt_command=" ${PROMPT_COMMAND:- } "
301+ existing_prompt_command=" ${existing_prompt_command// $__bp_install_string [;$'\n']} " # Edge case of appending to PROMPT_COMMAND
301302 existing_prompt_command=" ${existing_prompt_command// $__bp_install_string } "
302303 __bp_sanitize_string existing_prompt_command " $existing_prompt_command "
303304
@@ -328,7 +329,7 @@ __bp_install_after_session_init() {
328329 __bp_require_not_readonly PROMPT_COMMAND HISTCONTROL HISTTIMEFORMAT || return
329330
330331 local sanitized_prompt_command
331- __bp_sanitize_string sanitized_prompt_command " $PROMPT_COMMAND "
332+ __bp_sanitize_string sanitized_prompt_command " ${ PROMPT_COMMAND:- } "
332333 if [[ -n " $sanitized_prompt_command " ]]; then
333334 PROMPT_COMMAND=${sanitized_prompt_command} $' \n '
334335 fi ;
You can’t perform that action at this time.
0 commit comments