This works in bash
(parse_git_branch
is a defined function)
export PS1="\$(parse_git_branch)"
But I cannot figure out the equivalent in zsh
.
Note: If I do
PROMPT="$(parse_git_branch)"
It seems to work, but in fact it's running the command when I set the prompt, which is not the point.
Best Answer
You have to include
in your
.zshrc
,man zshall
explains it in the PROMPT EXPANSION section: