fixed inline git support

This commit is contained in:
Tim 2015-10-19 15:04:01 +02:00
parent 980e4cd170
commit 5749b4e690
2 changed files with 5 additions and 6 deletions

View File

@ -61,7 +61,7 @@ if [ -n "$force_color_prompt" ]; then
fi fi
fi fi
source ~/.git-prompt . ~/.git-prompt
# ANSI color codes # ANSI color codes
RS="\[\033[0m\]" # reset RS="\[\033[0m\]" # reset
@ -88,14 +88,13 @@ BWHT="\[\033[47m\]" # background white
if [ "$color_prompt" = yes ]; then if [ "$color_prompt" = yes ]; then
#PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' #PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
#PS1="\[\033[01;37m\]\$? \$(if [[ \$? == 0 ]]; then echo \"\[\033[01;32m\]\342\234\223\"; else echo \"\[\033[01;31m\]\342\234\227\"; fi) $(if [[ ${EUID} == 0 ]]; then echo '\[\033[01;31m\]\h'; else echo '\[\033[01;32m\]\u@\h'; fi)\[\033[01;34m\] \w \$\[\033[00m\] " #PS1="\[\033[01;37m\]\$? \$(if [[ \$? == 0 ]]; then echo \"\[\033[01;32m\]\342\234\223\"; else echo \"\[\033[01;31m\]\342\234\227\"; fi) $(if [[ ${EUID} == 0 ]]; then echo '\[\033[01;31m\]\h'; else echo '\[\033[01;32m\]\u@\h'; fi)\[\033[01;34m\] \w \$\[\033[00m\] "
PS1FRONT="$HC$FMAG[ $FGRN${debian_chroot:+($debian_chroot)}\u$FYEL@$FGRN\h$FYEL: $FBLE\w" PS1FRONT="$HC$FMAG[ $FGRN${debian_chroot:+($debian_chroot)}\u$FYEL@$FGRN\h$FYEL: $FBLE\w"
PS1BACK=" $FMAG]$FYEL\\$ $RS" PS1BACK=" $FMAG]$FYEL\\$ $RS"
#PS1="$PS1FRONT\$(__git_ps1_new)$PS1BACK"
#PS1=$PS1FRONT$PS1BACK
# git in bash # git in bash
PROMPT_COMMAND='__git_ps1 "'$PS1FRONT'" "'$PS1BACK'";' PROMPT_COMMAND='__git_ps1_new "'$PS1FRONT'" "'$PS1BACK'";'
unset PS1FRONT PS1BACK
else else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
PS2="> " PS2="> "

View File

@ -125,7 +125,7 @@
# `git-rev-list` # `git-rev-list`
# git | _Default_. Always compares `HEAD` to `@{upstream}` # git | _Default_. Always compares `HEAD` to `@{upstream}`
# svn | Always compares `HEAD` to `SVN` upstream # svn | Always compares `HEAD` to `SVN` upstream
__git_ps1 () __git_ps1_new ()
{ {
if [ "$(git config --bool bash.enableGitStatus)" == "false" ]; then return; fi if [ "$(git config --bool bash.enableGitStatus)" == "false" ]; then return; fi