Fix bug: themes break global $PROMPT_COMMAND variable
Safely append functions to $PROMPT_COMMAND instead of setting it.
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user