Skip to content

Instantly share code, notes, and snippets.

@ttristan
Last active May 26, 2022 13:43
Show Gist options
  • Save ttristan/a93b9bd1faad90760958930708fedf6f to your computer and use it in GitHub Desktop.
Save ttristan/a93b9bd1faad90760958930708fedf6f to your computer and use it in GitHub Desktop.
OSX bash profile showing colored paths with tilde and current git branch
#https://stackoverflow.com/a/20309062/3986530
#https://misc.flogisoft.com/bash/tip_colors_and_formatting
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
PS1="\[\033[0;49;36m\]\w\[\033[0;49;35m\]$(parse_git_branch) \[\033[1;49;94m\]->\[\e[m\] "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment