@@ -134,7 +134,11 @@ prompt_pure_preprompt_render() {
134134 # Add Git branch and dirty status info.
135135 typeset -gA prompt_pure_vcs_info
136136 if [[ -n $prompt_pure_vcs_info [branch] ]]; then
137- preprompt_parts+=(" %F{$git_color }" ' ${prompt_pure_vcs_info[branch]}${prompt_pure_git_dirty}%f' )
137+ local branch=" %F{$git_color }" ' ${prompt_pure_vcs_info[branch]}'
138+ if [[ -n $prompt_pure_vcs_info [action] ]]; then
139+ branch+=" |%F{$prompt_pure_colors [git:action]}" ' $prompt_pure_vcs_info[action]' " %F{$git_color }"
140+ fi
141+ preprompt_parts+=(" $branch " ' ${prompt_pure_git_dirty}%f' )
138142 fi
139143 # Git pull/push arrows.
140144 if [[ -n $prompt_pure_git_arrows ]]; then
@@ -248,18 +252,19 @@ prompt_pure_async_vcs_info() {
248252 # to be used or configured as the user pleases.
249253 zstyle ' :vcs_info:*' enable git
250254 zstyle ' :vcs_info:*' use-simple true
251- # Only export two message variables from `vcs_info`.
252- zstyle ' :vcs_info:*' max-exports 2
253- # Export branch (%b) and Git toplevel (%R).
255+ # Only export three message variables from `vcs_info`.
256+ zstyle ' :vcs_info:*' max-exports 3
257+ # Export branch (%b), Git toplevel (%R), and action (rebase/cherry-pick) (%a ).
254258 zstyle ' :vcs_info:git*' formats ' %b' ' %R'
255- zstyle ' :vcs_info:git*' actionformats ' %b|%a ' ' %R'
259+ zstyle ' :vcs_info:git*' actionformats ' %b' ' %R' ' %a '
256260
257261 vcs_info
258262
259263 local -A info
260264 info[pwd]=$PWD
261265 info[top]=$vcs_info_msg_1_
262266 info[branch]=$vcs_info_msg_0_
267+ info[action]=$vcs_info_msg_2_
263268
264269 print -r - ${(@ kvq)info}
265270}
@@ -446,6 +451,7 @@ prompt_pure_async_callback() {
446451 # Always update branch and top-level.
447452 prompt_pure_vcs_info[branch]=$info [branch]
448453 prompt_pure_vcs_info[top]=$info [top]
454+ prompt_pure_vcs_info[action]=$info [action]
449455
450456 do_render=1
451457 ;;
@@ -672,6 +678,7 @@ prompt_pure_setup() {
672678 git:arrow cyan
673679 git:branch 242
674680 git:branch:cached red
681+ git:action 242
675682 host 242
676683 path blue
677684 prompt:error red
0 commit comments