If you are in a vcsh repo, display the repo name in the prompt

This commit is contained in:
David Thurstenson 2016-10-26 10:08:55 -05:00
parent bbe83b3384
commit 2cd660a915
1 changed files with 3 additions and 0 deletions

View File

@ -66,6 +66,9 @@ awman() {
if [ -n "$SSH_CLIENT" ]; then
# Remotely, hostname is red.
PS1="\[\033[38;5;4m\][\A]\[$(tput sgr0)\]\[\033[38;5;6m\][\[$(tput bold)\]\[$(tput sgr0)\]\[\033[38;5;14m\]\u\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;6m\]@\[$(tput bold)\]\[$(tput sgr0)\]\[\033[38;5;1m\]\h\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;6m\] \W]\[$(tput sgr0)\]\[\033[38;5;7m\]\\$ \[$(tput sgr0)\]"
elif [ -n "$VCSH_REPO_NAME" ]; then
# If in a vcsh repo env, add repo name in magenta.
PS1="\[\033[38;5;12m\][\[$(tput sgr0)\]\[\033[38;5;4m\]\A\[$(tput sgr0)\]\[\033[38;5;12m\]]\[$(tput sgr0)\]\[\033[38;5;6m\][\[$(tput sgr0)\]\[\033[38;5;14m\]\u\[$(tput sgr0)\]\[\033[38;5;6m\]@\h \[$(tput sgr0)\]\[\033[38;5;13m\]$VCSH_REPO_NAME\[$(tput sgr0)\]\[\033[38;5;6m\] \W]\[$(tput sgr0)\]\[\033[38;5;15m\]\\$ \[$(tput sgr0)\]"
else
# Locally, hostname is cyan.
PS1="\[\033[38;5;4m\][\A]\[$(tput sgr0)\]\[\033[38;5;6m\][\[$(tput bold)\]\[$(tput sgr0)\]\[\033[38;5;14m\]\u\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;6m\]@\h \W]\[$(tput sgr0)\]\[\033[38;5;7m\]\\$ \[$(tput sgr0)\]"