From e385094292db62c49e427a21395522ca96c2fb72 Mon Sep 17 00:00:00 2001 From: Shien Hong Date: Mon, 23 Mar 2015 10:36:12 -0700 Subject: [PATCH 1/3] Modify agnoster theme for Mac OSX Yosemite --- themes/agnoster.zsh-theme | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 8c7be6e01..bae9164e0 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -26,7 +26,8 @@ # A few utility functions to make it easy and re-usable to draw segmented prompts CURRENT_BG='NONE' -SEGMENT_SEPARATOR='' +SEGMENT_SEPARATOR='⮀' + # Begin a segment # Takes two arguments, background and foreground. Both can be omitted, @@ -74,9 +75,11 @@ prompt_git() { dirty=$(parse_git_dirty) ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git show-ref --head -s --abbrev |head -n1 2> /dev/null)" if [[ -n $dirty ]]; then - prompt_segment yellow black + prompt_segment red black + st=' ±' else prompt_segment green black + fi if [[ -e "${repo_path}/BISECT_LOG" ]]; then @@ -86,7 +89,7 @@ prompt_git() { elif [[ -e "${repo_path}/rebase" || -e "${repo_path}/rebase-apply" || -e "${repo_path}/rebase-merge" || -e "${repo_path}/../.dotest" ]]; then mode=" >R>" fi - + mode=$st; setopt promptsubst autoload -Uz vcs_info @@ -98,7 +101,7 @@ prompt_git() { zstyle ':vcs_info:*' formats ' %u%c' zstyle ':vcs_info:*' actionformats ' %u%c' vcs_info - echo -n "${ref/refs\/heads\// }${vcs_info_msg_0_%% }${mode}" + echo -n "${ref/refs\/heads\//⭠ }${vcs_info_msg_0_%% }${mode}" fi } From 9e8246003aaa627cb4eef658ee64f8350dae5021 Mon Sep 17 00:00:00 2001 From: Shien Hong Date: Wed, 25 Mar 2015 15:49:44 -0700 Subject: [PATCH 2/3] revert the unicode changes. Slightly modify the code so the special characters are shown as numeric unicode --- themes/agnoster.zsh-theme | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index bae9164e0..08648f6ee 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -26,7 +26,7 @@ # A few utility functions to make it easy and re-usable to draw segmented prompts CURRENT_BG='NONE' -SEGMENT_SEPARATOR='⮀' +SEGMENT_SEPARATOR='\ue0b0' # Begin a segment @@ -76,7 +76,7 @@ prompt_git() { ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git show-ref --head -s --abbrev |head -n1 2> /dev/null)" if [[ -n $dirty ]]; then prompt_segment red black - st=' ±' + st=' \u00b1' else prompt_segment green black @@ -101,7 +101,7 @@ prompt_git() { zstyle ':vcs_info:*' formats ' %u%c' zstyle ':vcs_info:*' actionformats ' %u%c' vcs_info - echo -n "${ref/refs\/heads\//⭠ }${vcs_info_msg_0_%% }${mode}" + echo -n "${ref/refs\/heads\//\ue0a0 }${vcs_info_msg_0_%% }${mode}" fi } From 66acf56c256377a909c07dd1155cfbe8542675ed Mon Sep 17 00:00:00 2001 From: Shien Hong Date: Wed, 25 Mar 2015 16:22:06 -0700 Subject: [PATCH 3/3] delete the dirty display since it's redundent to the color change on the bar --- themes/agnoster.zsh-theme | 2 -- 1 file changed, 2 deletions(-) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 08648f6ee..51e981ea1 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -76,7 +76,6 @@ prompt_git() { ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git show-ref --head -s --abbrev |head -n1 2> /dev/null)" if [[ -n $dirty ]]; then prompt_segment red black - st=' \u00b1' else prompt_segment green black @@ -89,7 +88,6 @@ prompt_git() { elif [[ -e "${repo_path}/rebase" || -e "${repo_path}/rebase-apply" || -e "${repo_path}/rebase-merge" || -e "${repo_path}/../.dotest" ]]; then mode=" >R>" fi - mode=$st; setopt promptsubst autoload -Uz vcs_info