Make bash prompt more colorful
As a side effect, bashrc is now also shellcheck clean :)
This commit is contained in:
parent
daa67974bf
commit
645959cdf6
|
@ -38,13 +38,17 @@ shopt -s checkwinsize
|
||||||
if [[ "$TERM" = "dumb" ]]; then
|
if [[ "$TERM" = "dumb" ]]; then
|
||||||
PS1="\u@\h:\w$ "
|
PS1="\u@\h:\w$ "
|
||||||
else
|
else
|
||||||
|
PURPLE="\e[0;35m"
|
||||||
|
YELLOW="\e[0;32m"
|
||||||
|
RED="\e[0;31m"
|
||||||
|
NOCOLOR="\e[m"
|
||||||
if [[ -f ~/.config/bash/git-prompt.sh ]]; then
|
if [[ -f ~/.config/bash/git-prompt.sh ]]; then
|
||||||
GIT_PROMPT='$(__git_ps1 "(%s)")'
|
GIT_PROMPT="\$(__git_ps1 \"${PURPLE}(${NOCOLOR}%s${PURPLE})${NOCOLOR}\")"
|
||||||
else
|
else
|
||||||
GIT_PROMPT=''
|
GIT_PROMPT=''
|
||||||
fi
|
fi
|
||||||
PS1="┌[\[\e[0;32m\u@\h\e[m\] [\[\e[0;31m\w\e[m\]] [\t] $GIT_PROMPT\n└── "
|
PS1="┌\[${PURPLE}[${YELLOW}\u@\h${PURPLE}] [${RED}\w${PURPLE}] [${NOCOLOR}\t${PURPLE}] ${GIT_PROMPT}\]\n└── "
|
||||||
unset GIT_PROMPT
|
unset GIT_PROMPT PURPLE YELLOW RED NOCOLOR
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Enable color support of ls and also add handy aliases
|
# Enable color support of ls and also add handy aliases
|
||||||
|
|
Loading…
Reference in New Issue