summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMarc Cornellà <hello@mcornella.com>2022-02-21 18:34:28 +0100
committerMarc Cornellà <hello@mcornella.com>2022-02-21 18:34:28 +0100
commit07b829c894738e4ad594dc5f8d73401fbd83f203 (patch)
tree659dbee9bb6b4bd4505d82f7ae29035193a32dfc /lib
parent3427da4057dbe302933a7b5b19b4e23bfb9d0969 (diff)
downloadzsh-07b829c894738e4ad594dc5f8d73401fbd83f203.tar.gz
zsh-07b829c894738e4ad594dc5f8d73401fbd83f203.tar.bz2
zsh-07b829c894738e4ad594dc5f8d73401fbd83f203.zip
fix(vcs_info): quote % in relevant fields on all current Zsh releases
Diffstat (limited to 'lib')
-rw-r--r--lib/vcs_info.zsh13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/vcs_info.zsh b/lib/vcs_info.zsh
index 01dcd90b6..edb515ce0 100644
--- a/lib/vcs_info.zsh
+++ b/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