Shell Prompt NG

User

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\]\n \[\033[1;32m\]>\[\033[0m\] '

Root

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\]\n \[\033[1;31m\]>\[\033[0m\] '