Skip to content

Instantly share code, notes, and snippets.

@gtallen1187
Created August 29, 2018 06:47
Show Gist options
  • Save gtallen1187/60f02243c7f01687857d87c44e19ee44 to your computer and use it in GitHub Desktop.
Save gtallen1187/60f02243c7f01687857d87c44e19ee44 to your computer and use it in GitHub Desktop.
# TERMINAL PROMPT
# Git branch script from http://martinfitzpatrick.name/article/add-git-branch-name-to-terminal-prompt-mac
# Custom bash prompt via kirsle.net/wizards/ps1.html
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\[$(tput bold)\]\[$(tput setaf 5)\]⌘ \[$(tput setaf 6)\]\w\[$(tput setaf 3)\]\$(parse_git_branch) \[$(tput sgr0)\]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment