Check for empty or whitespace PROMPT_COMMAND before appending preexec_invoke_cmd
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user