You are not logged in.
I'm having some troubles with __git_ps1 to show the current git branch in terminal. The bug happen if I press TAB, Up, Down or Paste something in terminal.
My PS1 using __git_ps1, not works
export PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[31m\] $(__git_ps1 "\033[01;33m{%s}") \033[1;31m$\[\033[00m\] '
My PS1 using a function, not works too
function git_branch_name() {
git branch 2>/dev/null | grep -e '^*' | sed -E 's/^\* (.+)$/{\1} /'
}
export PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[31m\] \033[01;33m$(git_branch_name)\033[1;31m$\[\033[00m\] '
In this example, I used ls /etc and press up key:
Last edited by MaykeFA (2015-02-03 17:30:27)
Offline
Solved. Now is working fine with git branch diretory.
export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[31m\] $(__git_ps1 "\[\033[01;33m\]{%s}")\[\033[1;31m\]$\[\033[00m\] '
Offline