From 780d1a5a08589afa051271bbe6c74c1f2e05c368 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Thu, 25 Aug 2016 18:59:34 +0300 Subject: [PATCH] Prevent parameter expansion in preprompt By unsetting `prompt_subst` for the `prompt_pure_preprompt_render` function we can avoid e.g. git branch names with a `$`-sign to be expanded as parameters. Fixes #224 and #225 (as a result of 6cbd49a). --- pure.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pure.zsh b/pure.zsh index b0ecfbf..1db1813 100644 --- a/pure.zsh +++ b/pure.zsh @@ -123,6 +123,9 @@ prompt_pure_string_length_to_var() { } prompt_pure_preprompt_render() { + # make sure prompt_subst is unset to prevent parameter expansion in prompt + setopt local_options no_prompt_subst + # check that no command is currently running, the preprompt will otherwise be rendered in the wrong place [[ -n ${prompt_pure_cmd_timestamp+x} && "$1" != "precmd" ]] && return