From e385094292db62c49e427a21395522ca96c2fb72 Mon Sep 17 00:00:00 2001 From: Shien Hong Date: Mon, 23 Mar 2015 10:36:12 -0700 Subject: [PATCH 1/6] 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/6] 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/6] 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 From 5fcc2fa4cdcccce184cf30e782c8dc3df68a42ea Mon Sep 17 00:00:00 2001 From: Shien Hong Date: Wed, 25 Mar 2015 17:55:31 -0700 Subject: [PATCH 4/6] revert color change to original --- themes/agnoster.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 51e981ea1..69c73b1e4 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -75,7 +75,7 @@ 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 red black + prompt_segment yellow black else prompt_segment green black From 2d346d03e9f828ecddecdc9d120aef7e342f1b5c Mon Sep 17 00:00:00 2001 From: Shien Hong Date: Wed, 25 Mar 2015 18:01:06 -0700 Subject: [PATCH 5/6] revert the spacing to original file --- themes/agnoster.zsh-theme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 69c73b1e4..d0045f869 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -75,10 +75,9 @@ 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 yellow black else prompt_segment green black - fi if [[ -e "${repo_path}/BISECT_LOG" ]]; then @@ -88,6 +87,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 + setopt promptsubst autoload -Uz vcs_info From 74a35955fb0ae2498d750acbff02833e4d93dfb8 Mon Sep 17 00:00:00 2001 From: Shien Hong Date: Wed, 25 Mar 2015 18:02:08 -0700 Subject: [PATCH 6/6] more changes to match the original file --- themes/agnoster.zsh-theme | 1 - 1 file changed, 1 deletion(-) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index d0045f869..201198e3c 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -28,7 +28,6 @@ CURRENT_BG='NONE' SEGMENT_SEPARATOR='\ue0b0' - # Begin a segment # Takes two arguments, background and foreground. Both can be omitted, # rendering default background/foreground.