Check for empty or whitespace PROMPT_COMMAND before appending preexec_invoke_cmd
parent
6060c87178
commit
3b56275ef6
|
|
@ -122,7 +122,11 @@ function preexec_install () {
|
|||
shopt -s extdebug > /dev/null 2>&1
|
||||
|
||||
# Finally, install the actual traps.
|
||||
PROMPT_COMMAND="${PROMPT_COMMAND};preexec_invoke_cmd"
|
||||
if [[ ! -z "${PROMPT_COMMAND// }" ]]; then
|
||||
PROMPT_COMMAND="${PROMPT_COMMAND};preexec_invoke_cmd"
|
||||
else
|
||||
PROMPT_COMMAND="preexec_invoke_cmd"
|
||||
fi
|
||||
trap 'preexec_invoke_exec' DEBUG
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue