Last active
May 26, 2022 13:43
-
-
Save ttristan/a93b9bd1faad90760958930708fedf6f to your computer and use it in GitHub Desktop.
OSX bash profile showing colored paths with tilde and current git branch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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