From 6cbd49ad5c4cfa1d2e1dc5daf4a1e45c8596097a Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Thu, 25 Aug 2016 12:22:36 +0300 Subject: [PATCH] Fix double variable interpolation in branch name This commit prevents a git branch named e.g. `$TMPPREFIX` from being expanded into the actual contents of the `$TMPPREFIX` variable. Fixes #224. --- pure.zsh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pure.zsh b/pure.zsh index b0ecfbf..2c78ab3 100644 --- a/pure.zsh +++ b/pure.zsh @@ -132,8 +132,9 @@ prompt_pure_preprompt_render() { # construct preprompt, beginning with path local preprompt="%F{blue}%~%f" - # git info - preprompt+="%F{$git_color}${vcs_info_msg_0_}${prompt_pure_git_dirty}%f" + # git info, delay evaluation of branch name until the prompt expansion to + # prevent e.g. double variable interpolation + preprompt+="%F{$git_color}"'$vcs_info_msg_0_'"${prompt_pure_git_dirty}%f" # git pull/push arrows preprompt+="%F{cyan}${prompt_pure_git_arrows}%f" # username and machine if applicable