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).
This commit is contained in:
3
pure.zsh
3
pure.zsh
@@ -123,6 +123,9 @@ prompt_pure_string_length_to_var() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
prompt_pure_preprompt_render() {
|
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
|
# 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
|
[[ -n ${prompt_pure_cmd_timestamp+x} && "$1" != "precmd" ]] && return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user