dev-perso: Add current branch name in window title for git

* when the project uses git, include the current branch name
in the terminal window title
This commit is contained in:
François Revol 2012-08-22 01:16:15 +02:00
parent b9398be907
commit 70449c90d9

View File

@ -162,6 +162,9 @@ dev() {
test -z "$DEVUPCMD" -a \( -f _FOSSIL_ -o -f .fslckout \) && DEVUPCMD="fossil update"
test -z "$DEVUPCMD" -a -n "$P4PORT" && DEVUPCMD="p4 sync"
test -n "$DEVUPCMD" && history -s "$DEVUPCMD"
# spice up terminal window title for git, add current branch name
test -d .git && PROMPT_COMMAND='echo -en "\033]0;['$DEVPROJ':`git branch | sed "/^[^*]/d;s/^\*\s//"`:${PWD##*/}]\a"'
}
complete -W complete -W "$(dev)" dev