浏览代码

fix(vcs_info): quote % in relevant fields on all current Zsh releases

Marc Cornellà 2 年之前
父节点
当前提交
07b829c894
共有 1 个文件被更改,包括 8 次插入5 次删除
  1. 8 5
      lib/vcs_info.zsh

+ 8 - 5
lib/vcs_info.zsh

@@ -1,8 +1,11 @@
-# Impacted versions go from v5.0.3 to v5.8 (v5.8.1 is the first patched version)
-autoload -Uz is-at-least
-if is-at-least 5.8.1 || ! is-at-least 5.0.3; then
-  return
-fi
+# Don't skip this file until a Zsh release does the necessary quoting.
+# This is because even though 5.8.1 undid recursive prompt_subst inside
+# prompt sequences, % characters in relevant fields will still be rendered
+# incorrectly in vcs_info, on all Zsh releases up to writing this.
+#
+# There is no release yet that does this right, since it requires changing
+# how what vcs_info hooks expect to receive. Even so, I'd rather be correct
+# and break custom vcs_info hooks than have a broken prompt.
 
 # Quote necessary $hook_com[<field>] items just before they are used
 # in the line "VCS_INFO_hook 'post-backend'" of the VCS_INFO_formats