Last active
July 20, 2018 15:16
-
-
Save emgoeddel/3209638 to your computer and use it in GitHub Desktop.
Lizzie's bash prompt
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
#Paste into .bashrc for git branch in the prompt! | |
#Plus colors: username in green, @ in default, hostname in blue, pwd in purple, $ and remaining text in default. | |
#Looks good if you're using black background, white/gray text. | |
#If you're in a git repository, branch appears in cyan. | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \1/' | |
} | |
# Custom bash prompt via kirsle.net/wizards/ps1.html with some manual | |
# changes | |
export PS1="\[$(tput setaf 2)\]\[$(tput bold)\]\u\[$(tput sgr0)\]@\[$(tput setaf 4)\]\[$(tput bold)\]\h\[$(tput sgr0)\]: \[$(tput setaf 5)\]\[$(tput bold)\]\w\[$(tput sgr0)\]\[$(tput setaf 6)\]\[$(tput bold)\]\$(parse_git_branch)\[\033[00m\] \[$(tput sgr0)\]$\n\[$(tput sgr0)\]" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment