-
emerge app-shells/bash-completion
-
$ find /usr -name git-prompt.sh.bz2 /usr/share/doc/git-1.8.5.5/git-prompt.sh.bz2
-
cp /usr/share/doc/git-1.8.5.5/git-prompt.sh.bz2 ~
-
bunzip2 git-prompt.sh.bz2
-
mv git-prompt.sh .git-prompt.sh
-
Paste into ~/.bashrc
# Bash completion if [ -f /etc/bash_completion ]; then . /etc/bash_completion fi export PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w\[\033[01;33m\]$(__git_ps1)\[\033[01;34m\] \$\[\033[00m\] ' export GIT_PS1_SHOWDIRTYSTATE=1 source ~/.git-prompt.sh
-
-
Save d4rk5eed/d1651aa46e42d91ef96f to your computer and use it in GitHub Desktop.
It works fine but i'll end up with empty titles in my terminal. Even worse it will keep titles of other bash instances if i do ssh into another machine. Is there any way to fix this?
@r7l What do you mean exactly? I don't have this problem. This shouldn't affect your title at all as far as I know
I am using XFCE-Terminal and any newly opened terminal will just show Untitled since i've copied in the code from above and sourced that git-prompt.sh. Maybe it is related to XFCE-Terminal then.
@r7l Hmm strange. I use XFCE terminal too, and I don't have that issue.
I dont know which version you use, but did you use the decompressed one or the one I mentioned in the new location? I wonder if there is a difference there. I always run bleeding edge stuff, which is why i choose gentoo in the first place. I don't mind things being considered unstable.
@r7l have you checked the settings that it actually shows the title? That's a setting in xfce-terminal
It is set to Dynamically set title and i've tried all the options. It is (and was) working without the above .bashrc lines. It also works perfectly once i ssh into any other machine not having this .bashrc entries
It even works when switching to root user as i don't have those entries there. So it has to be within git-prompt.sh file or the 2 export lines
Impossible to show numbers, like (master|✖2✚3)?
I don't know; you'd have to check which variables are available within this script
In the current version of gentoo, the git-prompt shell script has moved and is already uncompressed. Replace the last line with: