diff --git a/gitprompt.sh b/gitprompt.sh index 70b11b6..6c7f6c9 100755 --- a/gitprompt.sh +++ b/gitprompt.sh @@ -287,6 +287,7 @@ function git_prompt_config() { fi # __GIT_STATUS_CMD defined fi + unset GIT_BRANCH } function setLastCommandState() { @@ -452,7 +453,7 @@ function updatePrompt() { local -a git_status_fields git_status_fields=($("$__GIT_STATUS_CMD" 2>/dev/null)) - local GIT_BRANCH=$(replaceSymbols ${git_status_fields[0]}) + export GIT_BRANCH=$(replaceSymbols ${git_status_fields[0]}) local GIT_REMOTE="$(replaceSymbols ${git_status_fields[1]})" if [[ "." == "$GIT_REMOTE" ]]; then unset GIT_REMOTE diff --git a/themes/Solarized_UserHost.bgptheme b/themes/Solarized_UserHost.bgptheme new file mode 100644 index 0000000..4eea2f1 --- /dev/null +++ b/themes/Solarized_UserHost.bgptheme @@ -0,0 +1,23 @@ +# This theme for gitprompt.sh is optimized for the "Solarized Dark" and "Solarized Light" color schemes +# based on "Solarized Extravagant", with user@host on the second line and some things removed. + +function override_git_prompt_colors() { + GIT_PROMPT_THEME_NAME='Solarized UserHost' + GIT_PROMPT_STAGED="${Yellow}● " + GIT_PROMPT_UNTRACKED="${Cyan}… " + GIT_PROMPT_STASHED="${BoldMagenta}⚑ " + GIT_PROMPT_CLEAN="${Green}✔ " + GIT_PROMPT_COMMAND_OK="${Green}✔ " + GIT_PROMPT_COMMAND_FAIL="${Red}✘ " + + GIT_PROMPT_START_USER="_LAST_COMMAND_INDICATOR_ ${Yellow}${PathShort}" + GIT_PROMPT_START_ROOT="${GIT_PROMPT_START_USER}" + GIT_PROMPT_END_USER="\n${Blue}\\u${White}@${BoldBlue}\\h ${BoldRed} ➤ ${ResetColor} " + GIT_PROMPT_END_ROOT="\n${Blue}\\u${White}@${BoldBlue}\\h ${BoldRed} #️ ${ResetColor} " + GIT_PROMPT_LEADING_SPACE=1 + GIT_PROMPT_PREFIX="${Cyan}[" + GIT_PROMPT_SUFFIX="${Cyan}]" + GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING="✭" +} + +reload_git_prompt_colors 'Solarized UserHost'