From 40fd3813d31a902a21c285c2ecf31d7d80dbe499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E4=BF=A1sxq?= Date: Sun, 31 Dec 2017 16:20:55 +0800 Subject: [PATCH 1/2] remove the escape char to fix git repo branch prompt show error --- themes/base.theme.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index a18c3729..a062bc7f 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -134,7 +134,7 @@ function git_prompt_minimal_info { _git-hide-status && return - SCM_BRANCH="${SCM_THEME_BRANCH_PREFIX}\$(_git-friendly-ref)" + SCM_BRANCH="${SCM_THEME_BRANCH_PREFIX}$(_git-friendly-ref)" if [[ -n "$(_git-status | tail -n1)" ]]; then SCM_DIRTY=1 @@ -150,7 +150,7 @@ function git_prompt_minimal_info { function git_prompt_vars { if _git-branch &> /dev/null; then SCM_GIT_DETACHED="false" - SCM_BRANCH="${SCM_THEME_BRANCH_PREFIX}\$(_git-friendly-ref)$(_git-remote-info)" + SCM_BRANCH="${SCM_THEME_BRANCH_PREFIX}$(_git-friendly-ref)$(_git-remote-info)" else SCM_GIT_DETACHED="true" @@ -160,7 +160,7 @@ function git_prompt_vars { else detached_prefix=${SCM_THEME_DETACHED_PREFIX} fi - SCM_BRANCH="${detached_prefix}\$(_git-friendly-ref)" + SCM_BRANCH="${detached_prefix}$(_git-friendly-ref)" fi IFS=$'\t' read -r commits_behind commits_ahead <<< "$(_git-upstream-behind-ahead)" From 517f6c94f93fb441e336f330659dc4c749826c0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E4=BF=A1sxq?= Date: Tue, 2 Jan 2018 18:10:38 +0800 Subject: [PATCH 2/2] revert the backslash in the base file, and remove it in theme 'axin', fix the git branch name show error --- themes/axin/axin.theme.bash | 2 +- themes/base.theme.bash | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/themes/axin/axin.theme.bash b/themes/axin/axin.theme.bash index e398cb18..d5e91753 100644 --- a/themes/axin/axin.theme.bash +++ b/themes/axin/axin.theme.bash @@ -30,7 +30,7 @@ else fi function prompt_command() { - PS1="\[${BOLD}${MAGENTA}\]\u \[$WHITE\]@ \[$ORANGE\]\h \[$WHITE\]in \[$GREEN\]\w\[$WHITE\]\[$SCM_THEME_PROMPT_PREFIX\]$(clock_prompt) \[$PURPLE\]\$(scm_prompt_info) \n\$ \[$RESET\]" + PS1="\[${BOLD}${MAGENTA}\]\u \[$WHITE\]@ \[$ORANGE\]\h \[$WHITE\]in \[$GREEN\]\w\[$WHITE\]\[$SCM_THEME_PROMPT_PREFIX\]$(clock_prompt) \[$PURPLE\]$(scm_prompt_info) \n\$ \[$RESET\]" } THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"${white}"} diff --git a/themes/base.theme.bash b/themes/base.theme.bash index a062bc7f..a18c3729 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -134,7 +134,7 @@ function git_prompt_minimal_info { _git-hide-status && return - SCM_BRANCH="${SCM_THEME_BRANCH_PREFIX}$(_git-friendly-ref)" + SCM_BRANCH="${SCM_THEME_BRANCH_PREFIX}\$(_git-friendly-ref)" if [[ -n "$(_git-status | tail -n1)" ]]; then SCM_DIRTY=1 @@ -150,7 +150,7 @@ function git_prompt_minimal_info { function git_prompt_vars { if _git-branch &> /dev/null; then SCM_GIT_DETACHED="false" - SCM_BRANCH="${SCM_THEME_BRANCH_PREFIX}$(_git-friendly-ref)$(_git-remote-info)" + SCM_BRANCH="${SCM_THEME_BRANCH_PREFIX}\$(_git-friendly-ref)$(_git-remote-info)" else SCM_GIT_DETACHED="true" @@ -160,7 +160,7 @@ function git_prompt_vars { else detached_prefix=${SCM_THEME_DETACHED_PREFIX} fi - SCM_BRANCH="${detached_prefix}$(_git-friendly-ref)" + SCM_BRANCH="${detached_prefix}\$(_git-friendly-ref)" fi IFS=$'\t' read -r commits_behind commits_ahead <<< "$(_git-upstream-behind-ahead)"