From e007cd9f8853a69a2e313e65a1d04d4e05120243 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Tue, 7 Feb 2017 08:57:33 +0000 Subject: 40510: vcs_info: Update the $psvar episode with '%'-unescaping. (Follow-up to 40492.) --- ChangeLog | 3 +++ Misc/vcs_info-examples | 2 +- README | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 787c27e1e..ea2a08476 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2017-02-09 Daniel Shahaf + * 40510: Misc/vcs_info-examples, README: vcs_info: Update the + $psvar episode with '%'-unescaping. (Follow-up to 40492.) + * 40492: Doc/Zsh/contrib.yo, Etc/BUGS, Functions/VCS_Info/Backends/VCS_INFO_get_data_hg, Functions/VCS_Info/VCS_INFO_set-patch-format, README: vcs_info: diff --git a/Misc/vcs_info-examples b/Misc/vcs_info-examples index 766eb82a4..58dd8cf98 100644 --- a/Misc/vcs_info-examples +++ b/Misc/vcs_info-examples @@ -31,7 +31,7 @@ precmd() { psvar=() vcs_info - [[ -n $vcs_info_msg_0_ ]] && psvar[1]="$vcs_info_msg_0_" + [[ -n $vcs_info_msg_0_ ]] && print -v 'psvar[1]' -Pr -- "$vcs_info_msg_0_" } # You can now use `%1v' to drop the $vcs_info_msg_0_ contents in your prompt; diff --git a/README b/README index 594b6f1cd..432a35e76 100644 --- a/README +++ b/README @@ -69,8 +69,11 @@ patch-format string, to prevent literal `%' signs in the interpolated value from being interpreted as prompt escape sequences. If you use ${vcs_info_msg_0_} in a context other than the shell prompt, you may need to undo the escaping with: + print -v vcs_info_msg_0_ -Pr -- "${vcs_info_msg_0_}" +This is also needed if $vcs_info_msg_0_ is used to set $psvar. + Incompatibilities between 5.0.8 and 5.3 ---------------------------------------- -- cgit 1.4.1