From e25bed59562cdf8b991d20db7ad1a37e64aeeeda Mon Sep 17 00:00:00 2001 From: Jannik Zander Date: Mon, 23 May 2016 19:19:47 +0200 Subject: [PATCH] Fix PS1 not updating --- .config/profile/rc/prompt.sh | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.config/profile/rc/prompt.sh b/.config/profile/rc/prompt.sh index b1d54f8..6a884d4 100644 --- a/.config/profile/rc/prompt.sh +++ b/.config/profile/rc/prompt.sh @@ -25,10 +25,11 @@ if [ -f "${HOME}/.config/profile/rc/git-prompt.sh" ]; then export GIT_PS1_SHOWUNTRACKEDFILES=1 export GIT_PS1_SHOWUPSTREAM="auto" export GIT_PS1_STATESEPARATOR=" [" - fi -prompt_git() { + +prompt_git() +{ local s="" local branchName="" @@ -48,12 +49,12 @@ prompt_git() { # check for unstaged changes if ! $(git diff-files --quiet --ignore-submodules --); then - s="$s!"; + s="$s*"; fi # check for untracked files if [ -n "$(git ls-files --others --exclude-standard)" ]; then - s="$s?"; + s="$s%"; fi # check for stashed files @@ -78,8 +79,8 @@ prompt_git() { fi } - -set_prompts() { +set_prompts() +{ local black="" local blue="" local bold="" @@ -95,12 +96,12 @@ set_prompts() { local hostStyle="" local userStyle="" + # Solarized colors + # (https://github.com/altercation/solarized/tree/master/iterm2-colors-solarized#the-values) if [ -x /usr/bin/tput ] && tput setaf 1 >& /dev/null; then bold=$(tput bold) reset=$(tput sgr0) - # Solarized colors - # (https://github.com/altercation/solarized/tree/master/iterm2-colors-solarized#the-values) black=$(tput setaf 0) blue=$(tput setaf 33) cyan=$(tput setaf 37) @@ -152,8 +153,8 @@ set_prompts() { PS1+="\[$hostStyle\]\h" # host PS1+="\[$reset$white\] in " PS1+="\[$green\]\w" # working directory - #PS1+="\$(prompt_git \"$white on $cyan\")" # git repository details - PS1+="$(__git_ps1 ' \[${white}\]on \[${cyan}\]%s]')"; # on branch +# PS1+="\$(prompt_git \"$white on $cyan\")" # git repository details + PS1+="\$(__git_ps1 ' \[${white}\]on \[${cyan}\]%s]')"; # on branch PS1+="\n" PS1+="\[$reset$white\]\$ \[$reset\]" # $ (and reset color) -- 2.43.0