From 17dee6721a649f1e8fbe63266ff72e4b51b0239c Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Tue, 30 Jun 2020 13:50:32 +0200 Subject: [PATCH] Use proper Git PS1 --- _bashrc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/_bashrc b/_bashrc index 72e51c4..f79e0cf 100644 --- a/_bashrc +++ b/_bashrc @@ -25,10 +25,9 @@ shopt -s checkwinsize # make less more friendly for non-text input files, see lesspipe(1) [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" -function git_ps1 { - [ -d .git ] && echo -n " [" && git name-rev --name-only @ | tr '\n' ']' -} -PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]`git_ps1`\$ ' +source /usr/share/git/git-prompt.sh +export GIT_PS1_SHOWCOLORHINTS=1 +PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]`__git_ps1`\$ ' # enable color support of ls and also add handy aliases if [ -x /usr/bin/dircolors ]; then