My New Shell Prompt
User
export PROMPT_DIRTRIM=2
git_branch() {
BRANCH=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')
[[ ! -z $BRANCH ]] && echo "[${BRANCH}] "
}
PS1='\n \w \[\e[33;1;12m\]$(git_branch)\[\033[0m\][\[\033[0;96m\]>\[\033[0m\]] '
Root
export PROMPT_DIRTRIM=2
git_branch() {
BRANCH=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')
[[ ! -z $BRANCH ]] && echo "[${BRANCH}] "
}
PS1='\n \w \[\e[33;1;12m\]$(git_branch)\[\033[0m\][\[\033[0;91m\]>\[\033[0m\]] '