diff --git a/.config/bash/.bashrc b/.config/bash/.bashrc index c14cc7c..0c655f7 100644 --- a/.config/bash/.bashrc +++ b/.config/bash/.bashrc @@ -110,9 +110,16 @@ git-prune() { git branch -vv | grep '\[origin/.*: gone\]' | awk '{print $1}' | xargs git branch -d } -# Set prompt -color_prompt=yes +# force_color_prompt=yes +if [ -n "$force_color_prompt" ]; then + if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + color_prompt=yes + else + color_prompt= + fi +fi +# Set prompt if [ "$color_prompt" = yes ]; then PS1="${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]\$(parse_git_branch)\[\033[00m\] \$ " else