diff --git a/bash/bashrc.common b/bash/bashrc.common index 9bbca29..0406513 100644 --- a/bash/bashrc.common +++ b/bash/bashrc.common @@ -7,10 +7,20 @@ add_to_path() { } # Define the colors used by the prompt -T_B=$(tput setaf 4) # Blue -T_G=$(tput setaf 2) # Green -T_Y=$(tput setaf 3) # Yellow -T_S=$(tput sgr0) # Reset +if [[ ! -z $TERM && "$TERM" != "dumb" ]] +then + T_B=$(tput setaf 4) # Blue + T_G=$(tput setaf 2) # Green + T_Y=$(tput setaf 3) # Yellow + T_S=$(tput sgr0) # Reset +else + # We've probably been invoked by an SSH command, there's no terminal + # to deal with. Don't bother coloring the prompt. + T_B='' + T_G='' + T_Y='' + T_S='' +fi # Import the Git prompt shell functions. These can be found # @github:git/git/contrib/completion/git_prompt.sh