Last active
October 9, 2019 09:07
-
-
Save jesuslg123/ca27189a1896758fe3fe4eaea956525b to your computer and use it in GitHub Desktop.
Bash prompt with time and branch
This file contains hidden or 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
# Git branch & date in prompt. | |
COLOR_PROMT="\[\033[00m\]" | |
COLOR_GIT="\[\033[33m\]" | |
COLOR_DATE="\[\033[34m\]" | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
export PS1="$COLOR_DATE[\t]$COLOR_PROMT \u@\h \W$COLOR_GIT\$(parse_git_branch)$COLOR_PROMT $ " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment