Browse Source

Patch PS1 for better git support - don't escape git function

Taylor Bockman 4 years ago
parent
commit
6582697957
  1. 6
      dotfiles/bash/bashrc

6
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

Loading…
Cancel
Save