Собственно сабж. Вот скрипт для получения моего:
case "${TERM}" in
xterm*|rxvt*)
clr_mode=9
;;
*)
clr_mode=3
;;
esac
if [ ${UID} -eq 0 ] ; then
usr_color="\e[0;31m"
usr_sign="#"
else
usr_color="\e[0;${clr_mode}2m"
usr_sign="\$"
fi
# source /usr/share/bash-completion/bash_completion
# или
# source /etc/bash_completion
# enable showing the dirty (unstaged/staged) state
export GIT_PS1_SHOWDIRTYSTATE=1
# enable showing the stashed state
export GIT_PS1_SHOWSTASHSTATE=1
# enable showing the untracked state
export GIT_PS1_SHOWUNTRACKEDFILES=1
# enable showing the upstream state
export GIT_PS1_SHOWUPSTREAM="auto verbose"
type __git_ps1 &>/dev/null && git_prompt='$(__git_ps1 " %s")'
if [ -n "$SSH_CLIENT" ]; then
host_prompt="\e[1;33m@$(echo $SSH_CONNECTION | awk '{print $3":"$4}')\e[m"
fi
PS1="\[${usr_color}\]\u\[\e[m\]$host_prompt \[\e[1;34m\]\w\[\e[m\]\[\e[1;35m\]${git_prompt}\[\e[m\] \[${usr_color}\]${usr_sign}\[\e[m\] "
unset color_prompt force_color_prompt git_prompt usr_color usr_sign host_prompt
В итоге выходит нечто такое:
\[\e[0;92m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\]\[\e[1;35m\]$(__git_ps1 " %s")\[\e[m\] \[\e[0;92m\]$\[\e[m\]
Выглядит так