zsh-workers
 help / color / mirror / code / Atom feed
fde38a1971c686ac0ecda31594abddca3eb99ca6 blob 16781 bytes (raw)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
 
From 1d557059a1ae35be86f17832526198abde8d949d Mon Sep 17 00:00:00 2001
From: Marlon Richert <marlon.richert@gmail.com>
Date: Thu, 15 Apr 2021 23:28:56 +0300
Subject: [PATCH] Add customizable `vcs` prompt theme

---
 0001-Add-customizable-vcs-prompt-theme.txt | 245 +++++++++++++++++++++
 Functions/Prompts/prompt_vcs_setup         | 227 +++++++++++++++++++
 2 files changed, 472 insertions(+)
 create mode 100644 0001-Add-customizable-vcs-prompt-theme.txt
 create mode 100644 Functions/Prompts/prompt_vcs_setup

diff --git a/0001-Add-customizable-vcs-prompt-theme.txt b/0001-Add-customizable-vcs-prompt-theme.txt
new file mode 100644
index 000000000..980f4a317
--- /dev/null
+++ b/0001-Add-customizable-vcs-prompt-theme.txt
@@ -0,0 +1,245 @@
+From 1d34a81c3b09228deaf9de599e42611ec4fe21dd Mon Sep 17 00:00:00 2001
+From: Marlon Richert <marlon.richert@gmail.com>
+Date: Thu, 15 Apr 2021 23:28:56 +0300
+Subject: [PATCH] Add customizable `vcs` prompt theme
+
+---
+ Functions/Prompts/prompt_vcs_setup | 226 +++++++++++++++++++++++++++++
+ 1 file changed, 226 insertions(+)
+ create mode 100644 Functions/Prompts/prompt_vcs_setup
+
+diff --git a/Functions/Prompts/prompt_vcs_setup b/Functions/Prompts/prompt_vcs_setup
+new file mode 100644
+index 000000000..218e6a5e2
+--- /dev/null
++++ b/Functions/Prompts/prompt_vcs_setup
+@@ -0,0 +1,226 @@
++##
++# Prompt that can be customized through vcs_info
++#
++
++autoload -Uz add-zle-hook-widget add-zsh-hook vcs_info
++
++# Standardized exit codes. See `man 3 sysexits`.
++if [[ ${(t)sysexits} != *readonly* ]]; then
++  # Avoid error in case this has been set already.
++  readonly -ga sysexits=(
++      USAGE
++      DATAERR
++      NOINPUT
++      NOUSER
++      NOHOST
++      UNAVAILABLE
++      SOFTWARE
++      OSERR
++      OSFILE
++      CANTCREAT
++      IOERR
++      TEMPFAIL
++      PROTOCOL
++      NOPERM
++      CONFIG
++  )
++fi
++
++# Prompt segments
++readonly -gHA _prompt_vcs_defaults=(
++    start:chpwd     $'\n%B%F{blue}%~%%b%f/\n'
++    start:left      $'%(?,%F{green},%F{red}%v%k\n%B%S)%#%%b%f%%s '
++    start:right     '%B%F{blue}%n%b%f%k@%F{magenta}%m%f'
++    start:staged    '%B%F{green}+%b%f'
++    start:unstaged  '%B%F{red}*%b%f'
++    start:action    '%B%F{red}%a%%b%f'
++    start:branch    '%B%F{cyan}%b%%b%f'
++    start:repo      '|%B%F{blue}%r%%b%f'
++    cont:indent     '  '
++    cont:left       ''
++    cont:right      '%F{red}%^%f'
++)
++
++prompt_vcs_help() {
++  print -r -- \
++"This prompt theme can by customized by copy-pasting any of the code below to
++your .zshrc file and editing it there:'
++
++  # For each of these,
++  # * the first string is used for \$PS1 after changing dirs,
++  # * the second string is used for \$PS1 otherwise, and
++  # * the third string is used for \$RPS1 and updated asynchronously.
++  # In these, %v expands to the name (if any) & number of the last exit code.
++  zstyle ':vcs_info:*:prompt_vcs:*' nvcsformats \
++      "${${:-$_prompt_vcs_defaults[start:chpwd]$_prompt_vcs_defaults[start:left]}//'%%'/%}" \
++      "${_prompt_vcs_defaults[start:left]//'%%'/%}" \
++      "${_prompt_vcs_defaults[start:right]//'%%'/%}"
++  zstyle ':vcs_info:*:prompt_vcs:*' formats \\
++      ${(q+):-$_prompt_vcs_defaults[start:chpwd]$_prompt_vcs_defaults[start:left]} \\
++      ${(q+)_prompt_vcs_defaults[start:left]} \\
++      ${(q+):-%u%c$_prompt_vcs_defaults[start:branch]$_prompt_vcs_defaults[start:repo]}
++  zstyle ':vcs_info:*:prompt_vcs:*' actionformats \\
++      ${(q+):-$_prompt_vcs_defaults[start:chpwd]$_prompt_vcs_defaults[start:left]} \\
++      ${(q+)_prompt_vcs_defaults[start:left]} \\
++      ${(q+):-%u%c$_prompt_vcs_defaults[start:action]$_prompt_vcs_defaults[start:repo]}
++
++  # These set the values of %c and %u, respectively:
++  zstyle ':vcs_info:*:prompt_vcs:*' stagedstr ${(q+)_prompt_vcs_defaults[start:staged]}
++  zstyle ':vcs_info:*:prompt_vcs:*' unstagedstr ${(q+)_prompt_vcs_defaults[start:unstaged]}
++
++For more info on the config above, see
++http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html and the end of
++http://zsh.sourceforge.net/Doc/Release/User-Contributions.html#vcs_005finfo-Configuration"
++}
++
++# Sets a style if it hasn't been set yet.
++_prompt_vcs_zstyle() {
++  local -a val
++  zstyle -g val "$1" "$2"
++  (( $#val )) ||
++      zstyle "$@"
++}
++
++_prompt_vcs_info() {
++  _prompt_vcs_zstyle ':vcs_info:*:prompt_vcs:*' max-exports 3 # Default is 2.
++
++  _prompt_vcs_zstyle ':vcs_info:*:prompt_vcs:*' nvcsformats \
++      "${${:-$_prompt_vcs_defaults[start:chpwd]$_prompt_vcs_defaults[start:left]}//'%%'/%}" \
++      "${_prompt_vcs_defaults[start:left]//'%%'/%}" \
++      "${_prompt_vcs_defaults[start:right]//'%%'/%}"
++  _prompt_vcs_zstyle ':vcs_info:*:prompt_vcs:*' formats \
++      "$_prompt_vcs_defaults[start:chpwd]$_prompt_vcs_defaults[start:left]" \
++      "$_prompt_vcs_defaults[start:left]" \
++      "%u%c$_prompt_vcs_defaults[start:branch]$_prompt_vcs_defaults[start:repo]"
++  _prompt_vcs_zstyle ':vcs_info:*:prompt_vcs:*' actionformats \
++      "$_prompt_vcs_defaults[start:chpwd]$_prompt_vcs_defaults[start:left]" \
++      "$_prompt_vcs_defaults[start:left]" \
++      "%u%c$_prompt_vcs_defaults[start:action]$_prompt_vcs_defaults[start:repo]"
++  _prompt_vcs_zstyle ':vcs_info:*:prompt_vcs:*' stagedstr \
++      "$_prompt_vcs_defaults[start:staged]"
++  _prompt_vcs_zstyle ':vcs_info:*:prompt_vcs:*' unstagedstr \
++      "$_prompt_vcs_defaults[start:unstaged]"
++
++  vcs_info prompt_vcs # Call with namespace.
++
++  print -rNC1 -- \
++      "${(q+)vcs_info_msg_0_}" "${(q+)vcs_info_msg_1_}" "${(q+)vcs_info_msg_2_}"
++}
++
++prompt_vcs_chpwd() {
++  emulate -L zsh
++
++  local -i fd=-1; local -a reply
++  exec {fd}< <(
++    # Fetch only staged changes at this point, for performance reasons.
++    _prompt_vcs_zstyle ':vcs_info:*:prompt_vcs:*' check-for-staged-changes yes
++    _prompt_vcs_info
++  )
++  IFS=$'\0' read -Aru "$fd"
++  typeset -ga __prompt_vcs_info_msg_=( "${(@Q)reply}" )
++  exec {fd}<&-
++
++  PS1="$__prompt_vcs_info_msg_[1]"
++  RPS1="$__prompt_vcs_info_msg_[3]"
++}
++
++prompt_vcs_precmd() {
++  local exitstatus=$? # Exit status of last command
++  emulate -L zsh
++
++  # Assign human-friendly exit status name to %v.
++  psvar[1]=
++  case $exitstatus in
++    ( <128-> )
++      psvar[1]="SIG$signals[exitstatus-127] "
++      ;|
++    ( <64-78> )
++      psvar[1]="EX_$sysexits[exitstatus-63] "
++      ;|
++    ( <1-> )
++      psvar[1]+="($exitstatus)"
++      ;;
++  esac
++}
++
++prompt_vcs_line-init() {
++  emulate -L zsh
++
++  case $CONTEXT in
++    start ) # (R)PS1
++      # Asynchronously check for unstaged changes. Do this here & not in
++      # precmd, so you can press Enter on an empty line to update VCS info.
++      local -i fd=-1
++      exec {fd}< <(
++        _prompt_vcs_zstyle ':vcs_info:*:prompt_vcs:*' check-for-changes yes
++        _prompt_vcs_info
++        print -r -- "$PWD"
++      )
++
++      # Add callback. Needs to be a widget, so we can refresh the prompt.
++      zle -Fw "$fd" prompt_vcs_fd-handler
++      ;;
++    cont )  # (R)PS2
++      # Indent left continuation prompt for each open shell construct.
++      local fmt="$_prompt_vcs_defaults[cont:indent]"
++      local -a indent=( '%('{1..$(( COLUMNS / ${(m)#fmt} ))}"_,$fmt,)" )
++      PS2="${(j::)indent}$_prompt_vcs_defaults[cont:left]"
++
++      RPS2="$_prompt_vcs_defaults[cont:right]"
++      ;;
++  esac
++}
++
++# Callback widget function for our async fetch of unstaged VCS changes
++prompt_vcs_fd-handler() {
++  emulate -L zsh
++
++  local -i fd=$1; local sig=$2; local -a reply
++  {
++    zle -F "$fd"  # Detach ourselves, so we don't get called more than once.
++
++    [[ $sig != (|hup) ]] &&
++        return  # Error occured
++
++    IFS=$'\0' read -Aru "$fd"
++
++    [[ $reply[-1] != $PWD ]] &&
++        return  # Abort if the info is not for the current dir.
++  } always {
++    exec {fd}<&-
++  }
++  shift -p reply
++  typeset -ga __prompt_vcs_info_msg_=( "${(@Q)reply}" )
++  RPS1="$__prompt_vcs_info_msg_[3]"
++  zle .reset-prompt
++}
++
++prompt_vcs_line-finish() {
++  emulate -L zsh
++  PS1="$__prompt_vcs_info_msg_[2]"
++}
++
++prompt_vcs_setup() {
++  prompt_opts=( cr percent sp ) # Tell promptinit which options to set.
++
++  PS4=$'# ?=%(?,%F{green},%B%F{red}%S)%?%b%f%s e=%e %F{green}%1N%f:%I %(1_,%F{yellow}%K{black}%_%f%k ,)'
++  SPROMPT='Correct %B%F{red}%U%R%b%f%u to %B%F{green}%r%b%f? [%Sy%ses|%Sn%so|%Se%sdit|%Sa%sbort] '
++  PROMPT_EOL_MARK='%S%F{cyan}%#%s%f'
++  zle_highlight=(
++      isearch:fg=black,bg=yellow
++      special:fg=cyan,bold
++      region:bg=blue
++      suffix:bg=blue
++      paste:none
++  )
++
++  add-zsh-hook chpwd  prompt_vcs_chpwd
++  add-zsh-hook precmd prompt_vcs_precmd
++  add-zle-hook-widget line-init   prompt_vcs_line-init
++  add-zle-hook-widget line-finish prompt_vcs_line-finish
++  zle -N prompt_vcs_fd-handler # Callback widget for async VCS update.
++
++  prompt_vcs_chpwd
++}
++
++prompt_vcs_setup "$@"
+-- 
+2.31.1
+
diff --git a/Functions/Prompts/prompt_vcs_setup b/Functions/Prompts/prompt_vcs_setup
new file mode 100644
index 000000000..66f167f49
--- /dev/null
+++ b/Functions/Prompts/prompt_vcs_setup
@@ -0,0 +1,227 @@
+##
+# Prompt that can be customized through vcs_info
+#
+
+autoload -Uz add-zle-hook-widget add-zsh-hook vcs_info
+
+# Standardized exit codes. See `man 3 sysexits`.
+if [[ ${(t)sysexits} != *readonly* ]]; then
+  # Avoid error in case this has been set already.
+  readonly -ga sysexits=(
+      USAGE
+      DATAERR
+      NOINPUT
+      NOUSER
+      NOHOST
+      UNAVAILABLE
+      SOFTWARE
+      OSERR
+      OSFILE
+      CANTCREAT
+      IOERR
+      TEMPFAIL
+      PROTOCOL
+      NOPERM
+      CONFIG
+  )
+fi
+
+# Prompt segments
+readonly -gHA _prompt_vcs_defaults=(
+    start:chpwd     $'\n%B%F{blue}%~%%b%f/\n'
+    start:left      $'%%(?,%F{green},%F{red}%v%k\n%B%%S)%#%%b%f%%s '
+    start:right     '%B%F{blue}%n%b%f%k@%F{magenta}%m%f'
+    start:staged    '%B%F{green}+%b%f'
+    start:unstaged  '%B%F{red}*%b%f'
+    start:action    '%B%F{red}%a%%b%f'
+    start:branch    '%B%F{cyan}%b%%b%f'
+    start:repo      '|%B%F{blue}%r%%b%f'
+    cont:indent     '  '
+    cont:left       ''
+    cont:right      '%F{red}%^%f'
+)
+
+prompt_vcs_help() {
+  print -r -- \
+"This prompt theme can by customized by copy-pasting any of the code below to
+your .zshrc file and editing it there:'
+
+  # For each of these,
+  # * the first string is used for \$PS1 after changing dirs,
+  # * the second string is used for \$PS1 otherwise, and
+  # * the third string is used for \$RPS1 and updated asynchronously.
+  # In these, %v expands to the name (if any) & number of the last exit code.
+  zstyle ':vcs_info:*:prompt_vcs:*' nvcsformats \
+      "${${:-$_prompt_vcs_defaults[start:chpwd]$_prompt_vcs_defaults[start:left]}//'%%'/%}" \
+      "${_prompt_vcs_defaults[start:left]//'%%'/%}" \
+      "${_prompt_vcs_defaults[start:right]//'%%'/%}"
+  zstyle ':vcs_info:*:prompt_vcs:*' formats \\
+      ${(q+):-$_prompt_vcs_defaults[start:chpwd]$_prompt_vcs_defaults[start:left]} \\
+      ${(q+)_prompt_vcs_defaults[start:left]} \\
+      ${(q+):-%u%c$_prompt_vcs_defaults[start:branch]$_prompt_vcs_defaults[start:repo]}
+  zstyle ':vcs_info:*:prompt_vcs:*' actionformats \\
+      ${(q+):-$_prompt_vcs_defaults[start:chpwd]$_prompt_vcs_defaults[start:left]} \\
+      ${(q+)_prompt_vcs_defaults[start:left]} \\
+      ${(q+):-%u%c$_prompt_vcs_defaults[start:action]$_prompt_vcs_defaults[start:repo]}
+
+  # These set the values of %c and %u, respectively:
+  zstyle ':vcs_info:*:prompt_vcs:*' stagedstr ${(q+)_prompt_vcs_defaults[start:staged]}
+  zstyle ':vcs_info:*:prompt_vcs:*' unstagedstr ${(q+)_prompt_vcs_defaults[start:unstaged]}
+
+For more info on the config above, see
+http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html and the end of
+http://zsh.sourceforge.net/Doc/Release/User-Contributions.html#vcs_005finfo-Configuration"
+}
+
+# Sets a style if it hasn't been set yet.
+_prompt_vcs_zstyle() {
+  local -a val
+  zstyle -g val "$1" "$2"
+  (( $#val )) ||
+      zstyle "$@"
+}
+
+_prompt_vcs_info() {
+  _prompt_vcs_zstyle ':vcs_info:*:prompt_vcs:*' max-exports 3 # Default is 2.
+
+  _prompt_vcs_zstyle ':vcs_info:*:prompt_vcs:*' nvcsformats \
+      "${${:-$_prompt_vcs_defaults[start:chpwd]$_prompt_vcs_defaults[start:left]}//'%%'/%}" \
+      "${_prompt_vcs_defaults[start:left]//'%%'/%}" \
+      "${_prompt_vcs_defaults[start:right]//'%%'/%}"
+  _prompt_vcs_zstyle ':vcs_info:*:prompt_vcs:*' formats \
+      "$_prompt_vcs_defaults[start:chpwd]$_prompt_vcs_defaults[start:left]" \
+      "$_prompt_vcs_defaults[start:left]" \
+      "%u%c$_prompt_vcs_defaults[start:branch]$_prompt_vcs_defaults[start:repo]"
+  _prompt_vcs_zstyle ':vcs_info:*:prompt_vcs:*' actionformats \
+      "$_prompt_vcs_defaults[start:chpwd]$_prompt_vcs_defaults[start:left]" \
+      "$_prompt_vcs_defaults[start:left]" \
+      "%u%c$_prompt_vcs_defaults[start:action]$_prompt_vcs_defaults[start:repo]"
+  _prompt_vcs_zstyle ':vcs_info:*:prompt_vcs:*' stagedstr \
+      "$_prompt_vcs_defaults[start:staged]"
+  _prompt_vcs_zstyle ':vcs_info:*:prompt_vcs:*' unstagedstr \
+      "$_prompt_vcs_defaults[start:unstaged]"
+
+  vcs_info prompt_vcs # Call with namespace.
+
+  print -rNC1 -- \
+      "${(q+)vcs_info_msg_0_}" "${(q+)vcs_info_msg_1_}" "${(q+)vcs_info_msg_2_}"
+}
+
+prompt_vcs_chpwd() {
+  emulate -L zsh
+
+  local -i fd=-1; local -a reply
+  exec {fd}< <(
+    # Fetch only staged changes at this point, for performance reasons.
+    _prompt_vcs_zstyle ':vcs_info:*:prompt_vcs:*' check-for-staged-changes yes
+    _prompt_vcs_info
+  )
+  IFS=$'\0' read -Aru "$fd"
+  typeset -ga _prompt_vcs_info_msg_=( "${(@Q)reply}" )
+  exec {fd}<&-
+
+  PS1="$_prompt_vcs_info_msg_[1]"
+  RPS1="$_prompt_vcs_info_msg_[3]"
+}
+
+prompt_vcs_precmd() {
+  local exitstatus=$? # Exit status of last command
+  emulate -L zsh
+
+  # Assign human-friendly exit status string to %v.
+  psvar[1]=
+  case $exitstatus in
+    ( <128-> )
+      psvar[1]="SIG$signals[exitstatus-127] "
+      ;|
+    ( <64-78> )
+      psvar[1]="EX_$sysexits[exitstatus-63] "
+      ;|
+    ( <1-> )
+      psvar[1]+="($exitstatus)"
+      ;;
+    # No need to show EX_OK.
+  esac
+}
+
+prompt_vcs_line-init() {
+  emulate -L zsh
+
+  case $CONTEXT in
+    start ) # (R)PS1
+      # Asynchronously check for unstaged changes. Do this here & not in
+      # precmd, so you can press Enter on an empty line to update VCS info.
+      local -i fd=-1
+      exec {fd}< <(
+        _prompt_vcs_zstyle ':vcs_info:*:prompt_vcs:*' check-for-changes yes
+        _prompt_vcs_info
+        print -r -- "$PWD"
+      )
+
+      # Add callback. Needs to be a widget, so we can refresh the prompt.
+      zle -Fw "$fd" prompt_vcs_fd-handler
+      ;;
+    cont )  # (R)PS2
+      # Indent left continuation prompt for each open shell construct.
+      local fmt="$_prompt_vcs_defaults[cont:indent]"
+      local -a indent=( '%('{1..$(( COLUMNS / ${(m)#fmt} ))}"_,$fmt,)" )
+      PS2="${(j::)indent}$_prompt_vcs_defaults[cont:left]"
+
+      RPS2="$_prompt_vcs_defaults[cont:right]"
+      ;;
+  esac
+}
+
+# Callback widget function for our async fetch of unstaged VCS changes
+prompt_vcs_fd-handler() {
+  emulate -L zsh
+
+  local -i fd=$1; local sig=$2; local -a reply
+  {
+    zle -F "$fd"  # Detach ourselves, so we don't get called more than once.
+
+    [[ $sig != (|hup) ]] &&
+        return  # Error occured
+
+    IFS=$'\0' read -Aru "$fd"
+
+    [[ $reply[-1] != $PWD ]] &&
+        return  # Abort if the info is not for the current dir.
+  } always {
+    exec {fd}<&-
+  }
+  shift -p reply
+  typeset -ga _prompt_vcs_info_msg_=( "${(@Q)reply}" )
+  RPS1="$_prompt_vcs_info_msg_[3]"
+  zle .reset-prompt
+}
+
+prompt_vcs_line-finish() {
+  emulate -L zsh
+  PS1="$_prompt_vcs_info_msg_[2]"
+}
+
+prompt_vcs_setup() {
+  prompt_opts=( cr percent sp ) # Tell promptinit which options to set.
+
+  PS4=$'# ?=%(?,%F{green},%B%F{red}%S)%?%b%f%s e=%e %F{green}%1N%f:%I %(1_,%F{yellow}%K{black}%_%f%k ,)'
+  SPROMPT='Correct %B%F{red}%U%R%b%f%u to %B%F{green}%r%b%f? [%Sy%ses|%Sn%so|%Se%sdit|%Sa%sbort] '
+  PROMPT_EOL_MARK='%S%F{cyan}%#%s%f'
+  zle_highlight=(
+      isearch:fg=black,bg=yellow
+      special:fg=cyan,bold
+      region:bg=blue
+      suffix:bg=blue
+      paste:none
+  )
+
+  add-zsh-hook chpwd    prompt_vcs_chpwd
+  add-zsh-hook precmd   prompt_vcs_precmd
+  add-zle-hook-widget line-init   prompt_vcs_line-init
+  add-zle-hook-widget line-finish prompt_vcs_line-finish
+  zle -N prompt_vcs_fd-handler # Callback widget for async VCS update.
+
+  prompt_vcs_chpwd
+}
+
+prompt_vcs_setup "$@"
-- 
2.31.1

debug log:

solving fde38a197 ...
found fde38a197 in https://inbox.vuxu.org/zsh-workers/29E16F69-B09E-44BF-9009-1CF53053D4FC@gmail.com/

applying [1/1] https://inbox.vuxu.org/zsh-workers/29E16F69-B09E-44BF-9009-1CF53053D4FC@gmail.com/
diff --git a/0001-Add-customizable-vcs-prompt-theme.patch b/0001-Add-customizable-vcs-prompt-theme.patch
new file mode 100644
index 000000000..fde38a197

1:267: trailing whitespace.
+-- 
1:503: trailing whitespace.
-- 
Checking patch 0001-Add-customizable-vcs-prompt-theme.patch...
1:505: new blank line at EOF.
+
Applied patch 0001-Add-customizable-vcs-prompt-theme.patch cleanly.
warning: 3 lines add whitespace errors.

index at:
100644 fde38a1971c686ac0ecda31594abddca3eb99ca6	0001-Add-customizable-vcs-prompt-theme.patch

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).