1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-05-21 15:36:04 +02:00

40510: vcs_info: Update the $psvar episode with '%'-unescaping. (Follow-up to 40492.)

This commit is contained in:
Daniel Shahaf 2017-02-07 08:57:33 +00:00
parent ecd88284f3
commit e007cd9f88
3 changed files with 7 additions and 1 deletions

View File

@ -1,5 +1,8 @@
2017-02-09 Daniel Shahaf <d.s@daniel.shahaf.name>
* 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:

View File

@ -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;

3
README
View File

@ -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
----------------------------------------