Fix for issue #883

pull/888/head
Ivan Font 2017-01-17 00:01:49 -08:00
parent 3a9c65d541
commit 1f0108193d
1 changed files with 8 additions and 6 deletions

View File

@ -464,11 +464,13 @@ function aws_profile {
} }
function safe_append_prompt_command { function safe_append_prompt_command {
if [[ -n $1 ]] ; then local prompt_re="\<${1}\>" # exact match regex
case $PROMPT_COMMAND in
*$1*) ;; if [[ ${PROMPT_COMMAND} =~ ${prompt_re} ]]; then
"") PROMPT_COMMAND="$1";; return
*) PROMPT_COMMAND="$1;$PROMPT_COMMAND";; elif [[ -z ${PROMPT_COMMAND} ]]; then
esac PROMPT_COMMAND="${1}"
else
PROMPT_COMMAND="${1};${PROMPT_COMMAND}"
fi fi
} }