Browse Source

Conditional PS1

master
Taylor Bockman 4 years ago
parent
commit
1a799d22c6
  1. 11
      dotfiles/bash/bashrc

11
dotfiles/bash/bashrc

@ -1,3 +1,5 @@
#! /usr/bin/env bash
# Use the iterm2 material theme in the root directory of the essentials repository. For linux,
# you will need to source a material theme color scheme for your terminal (for XFCE use nord in the xfce
# themes folder).
@ -49,5 +51,10 @@ 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.
export PS1=\
'\[$bold\]\[$white\]\u@\h\[$reset\]: \[$bold\]\[$blue\]\w\[$reset\] \[$green\]\[$(parse_git_branch)\]\[$reset\]\[$bold\]\[$white\]⇨\[$reset\] '
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\]\[$(parse_git_branch)\]\[$reset\]\[$bold\]\[$white\]⇨\[$reset\] '
else
export PS1='\[$bold\]\[$white\]\u@\h\[$reset\]: \[$bold\]\[$blue\]\w\[$reset\] \[$green\]\[$(parse_git_branch)\]\[$reset\]\[$bold\]\[$white\]⇨\[$reset\] '
fi

Loading…
Cancel
Save