]> git.zndr.dk Git - dotfiles.git/commitdiff
Fix prompt debian
authorJannik ZANDER <jannikz@gmail.com>
Sat, 30 Jun 2018 10:14:15 +0000 (12:14 +0200)
committerJannik ZANDER <jannikz@gmail.com>
Sat, 30 Jun 2018 10:14:15 +0000 (12:14 +0200)
.bashrc

diff --git a/.bashrc b/.bashrc
index 2fcd7b4c6ff3cade8e8dcfac8944fa470d4cedfa..a39e1c38f8502b1fa32bf62a4687980e48df73f6 100644 (file)
--- a/.bashrc
+++ b/.bashrc
@@ -4,10 +4,19 @@
 [[ -z "$PS1" ]] && return
 
 # Set prompt
-if test -z  "$TITLEPREFIX"; then
-  PS1='\[\033]0;$TITLEPREFIX:$PWD\007\]' # git for windows
+if test -z  "$debian_chroot"; then
+  PS1='${debian_chroot:+($debian_chroot)}'  # debian
 else
-  PS1='${debian_chroot:+($debian_chroot)}' # debian
+  PS1='\[\033]0;$TITLEPREFIX:$PWD\007\]'    # windows
+  GIT_EXEC_PATH="$(git --exec-path 2>/dev/null)"
+  COMPLETION_PATH="${GIT_EXEC_PATH%/libexec/git-core}"
+  COMPLETION_PATH="${COMPLETION_PATH%/lib/git-core}"
+  COMPLETION_PATH="$COMPLETION_PATH/share/git/completion"
+  if test -f "$COMPLETION_PATH/git-prompt.sh"
+  then
+    . "$COMPLETION_PATH/git-completion.bash"
+    . "$COMPLETION_PATH/git-prompt.sh"
+  fi
 fi
 
 PS1="$PS1"'\[\033[01;32m\]'    # change color
@@ -16,30 +25,17 @@ PS1="$PS1"'\[\033[00m\]'       # change color
 PS1="$PS1"':'                  # :
 PS1="$PS1"'\[\033[01;34m\]'    # change color
 PS1="$PS1"'\w'                 # current working directory
-
-GIT_EXEC_PATH="$(git --exec-path 2>/dev/null)"
-COMPLETION_PATH="${GIT_EXEC_PATH%/libexec/git-core}"
-COMPLETION_PATH="${COMPLETION_PATH%/lib/git-core}"
-COMPLETION_PATH="$COMPLETION_PATH/share/git/completion"
-if test -f "$COMPLETION_PATH/git-prompt.sh"
-then
-  . "$COMPLETION_PATH/git-completion.bash"
-  . "$COMPLETION_PATH/git-prompt.sh"
-  PS1="$PS1"'\[\033[31m\]'      # change color
-  PS1="$PS1"'`__git_ps1`'       # bash function
-fi
-PS1="$PS1"'\[\033[0m\]'        # change color
+PS1="$PS1"'\[\033[31m\]'       # change color
+PS1="$PS1"'`__git_ps1`'        # bash function
+PS1="$PS1"'\[\033[00m\]'       # change color
 PS1="$PS1"'\$ '                # prompt
 
-#  PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(__git_ps1 "(%s)")\$ '
-#  PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[31m\]$(__git_ps1 "(%s)")\[\033[01;34m\]\[\033[00m\]\$ '
-
 export GIT_PS1_SHOWDIRTYSTATE=1
-export GIT_PS1_SHOWCOLORHINTS=1
-export GIT_PS1_SHOWUNTRACKEDFILES=1
-export GIT_PS1_SHOWSTASHSTATE=1
-export GIT_PS1_SHOWUPSTREAM="auto"
-export GIT_PS1_HIDE_IF_PWD_IGNORED=1
+#export GIT_PS1_SHOWCOLORHINTS=1
+#export GIT_PS1_SHOWUNTRACKEDFILES=1
+#export GIT_PS1_SHOWSTASHSTATE=1
+#export GIT_PS1_SHOWUPSTREAM="auto"
+#export GIT_PS1_HIDE_IF_PWD_IGNORED=1
 
 # Whenever displaying the prompt, write the previous line to disk
 export PROMPT_COMMAND="history -a;"