There seems to be a problem with promptsubst
. RPROMPT="${vcs_info_msg_0_}"
will substitute the value of vcs_info_msg_0_
when RPROMPT
is first defined. That is the reason why it works when you open a shell in a repository but not when you change into one.
The single-quoted variant prevents this initial substitution and setopt promptsubst
should then do the substitution everytime the prompt is used. But in your case it doesn't, obviously. Possibly, there is a setopt nopromptsubst
somewhere in your zsh configuration that gets called after the one in prompt_bart_setup
.
See with setopt | grep promptsubst
if it is really set.