diff options
author | Alexander Blinne <alexander.blinne@uni-jena.de> | 2016-04-11 20:56:27 +0200 |
---|---|---|
committer | Alexander Blinne <alexander.blinne@uni-jena.de> | 2016-04-11 20:56:27 +0200 |
commit | 5e535df7f98a7f74adc2af6c23c37092725914c4 (patch) | |
tree | fcc16197085e2bd0ca4d1ad0c0b29fdf5431dee9 | |
parent | 58f2537732a3b48f69cc2cc7398527006998346e (diff) | |
download | bash-git-prompt-5e535df7f98a7f74adc2af6c23c37092725914c4.tar.xz |
Erste Version
-rw-r--r-- | bash-git-prompt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bash-git-prompt b/bash-git-prompt index 05a7907..9bce386 100644 --- a/bash-git-prompt +++ b/bash-git-prompt @@ -1,2 +1,12 @@ #!/bin/bash +PS='\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}<\t> \[\033[01;32m\]\u\[\033[00m\]@\[\033[01;33m\]\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]' + +set -o pipefail + +if branch=$(git branch 2>/dev/null | grep '\*' | cut -d' ' -f2) +then + PS1="$PS $branch\$ " +else + PS1="$PS\$ " +fi |