From 1d7841514292fe51c33479e6a8258fd44df7e84a Mon Sep 17 00:00:00 2001 From: Taylor Bockman Date: Mon, 23 Dec 2019 23:28:41 -0800 Subject: [PATCH] Patch PS1 for better git support - don't escape git function --- dotfiles/bash/bashrc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dotfiles/bash/bashrc b/dotfiles/bash/bashrc index bc3853a..1435d93 100644 --- a/dotfiles/bash/bashrc +++ b/dotfiles/bash/bashrc @@ -129,11 +129,9 @@ export PROMPT_DIRTRIM=2 # Important note for PS1 modification - everything non-printable must be escaped with `\[` and `\]`. Otherwise readline # fails to track the prompt right and things get messed up when you input long strings. -GIT_BRANCH=$(parse_git_branch) - if [[ "$OSTYPE" == "linux-gnu" ]]; then # I had some rendering issues running in XFCE unless I added an extra space at the end. - export PS1='\[$bold\]\[$white\]\u@\h\[$reset\]: \[$bold\]\[$blue\]\w\[$reset\] \[$green\]$GIT_BRANCH\[$reset\]\[$bold\]\[$white\]⇨\[$reset\] ' + export PS1='\[$bold\]\[$white\]\u@\h\[$reset\]: \[$bold\]\[$blue\]\w\[$reset\] \[$green\]$(parse_git_branch)\[$reset\]\[$bold\]\[$white\]⇨\[$reset\] ' else - export PS1='\[$bold\]\[$white\]\u@\h\[$reset\]: \[$bold\]\[$blue\]\w\[$reset\] \[$green\]$GIT_BRANCH\[$reset\]\[$bold\]\[$white\]⇨\[$reset\] ' + export PS1='\[$bold\]\[$white\]\u@\h\[$reset\]: \[$bold\]\[$blue\]\w\[$reset\] \[$green\]$(parse_git_branch)\[$reset\]\[$bold\]\[$white\]⇨\[$reset\] ' fi