Fix bug: themes break global $PROMPT_COMMAND variable

Safely append functions to $PROMPT_COMMAND instead of setting it.
This commit is contained in:
Yuhao Wu
2016-07-07 17:13:00 +09:00
parent 418b06e65c
commit af96da5d11
54 changed files with 62 additions and 53 deletions

View File

@@ -403,3 +403,12 @@ function aws_profile {
echo -e "default"
fi
}
function safe_append_prompt_command {
if [[ -n $1 ]] ; then
case $PROMPT_COMMAND in
*$1*) ;;
*) PROMPT_COMMAND="$1;$PROMPT_COMMAND";;
esac
fi
}