Skip to content

Instantly share code, notes, and snippets.

@bewitchingme
Last active November 27, 2015 01:31
Show Gist options
  • Save bewitchingme/0b3cf006629bd8d41e0f to your computer and use it in GitHub Desktop.
Save bewitchingme/0b3cf006629bd8d41e0f to your computer and use it in GitHub Desktop.
RS="\[\033[0m\]" # reset
HC="\[\033[1m\]" # hicolor
UL="\[\033[4m\]" # underline
INV="\[\033[7m\]" # inverse background and foreground
FBLK="\[\033[30m\]" # foreground black
FRED="\[\033[31m\]" # foreground red
FLRD="\e[91mLight red]"
FGRN="\[\033[32m\]" # foreground green
FYEL="\[\033[33m\]" # foreground yellow
FBLE="\[\033[34m\]" # foreground blue
FMAG="\[\033[35m\]" # foreground magenta
FCYN="\[\033[36m\]" # foreground cyan
FWHT="\[\033[37m\]" # foreground white
BBLK="\[\033[40m\]" # background black
BRED="\[\033[41m\]" # background red
BGRN="\[\033[42m\]" # background green
BYEL="\[\033[43m\]" # background yellow
BBLE="\[\033[44m\]" # background blue
BMAG="\[\033[45m\]" # background magenta
BCYN="\[\033[46m\]" # background cyan
BWHT="\[\033[47m\]" # background white
function streetsigns {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
hrps=$(heroku auth:whoami 2> /dev/null)
hu=" hu:[$hrps]"
echo ":("${ref#refs/heads/}")$hu"
}
if [ "$color_prompt" = yes ]; then
PS1="$HC$FGRN{ $FMAG${debian_chroot:+($debian_chroot)}\u$FWHT@$FRED\h$FCYN: $FYEL\w\$(streetsigns) $FGRN}$FWHT\\$ $RS"
PS2="$HC$FYEL> $RS"
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
@bewitchingme
Copy link
Author

Beware, when you're in any git repository heroku auth:whoami will be called each time the prompt is shown, so it can be a bit heavy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment