add check for color prompt support
This commit is contained in:
parent
01ca8adaff
commit
41017622d4
1 changed files with 9 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue