Created
March 22, 2019 15:59
-
-
Save heuermh/a3b5880714d1082cb9ff2b65317e7a57 to your computer and use it in GitHub Desktop.
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
# Generated 2015-09-14 by http://www.gilesorr.com/Code/bpb/ , | |
# The Bash Prompt Builder written by Giles Orr. | |
case ${TERM} in | |
xterm*|rxvt*) | |
TITLEBAR='\[\033]0;\u@\h:\w\007\]';; | |
*) | |
TITLEBAR='';; | |
esac; | |
# Elegant code courtesy of nitrous.io: | |
parse_git_branch () { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/" | |
} | |
parse_git_dirty () { | |
git diff --no-ext-diff --quiet --exit-code &>/dev/null || echo "!" | |
} | |
PROMPT_COMMAND="" | |
PS1="${TITLEBAR}\[\e[0;34m\]\W \[\e[1;34m\]\$(parse_git_branch)\n\ | |
\[\e[0;32m\]\$ \[\e[1;37m\]" | |
alias ls="ls -G" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment