my .bash_profile is setting up my prompt like this
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "
however, the result is that my prompt looks like this:
\u@\h \W\[\033[32m\]$(parse_git_branch)\[\033[00m\] $
Just to get the username I tried the following so ANSI could be used in zsh
PROMPT=$'%{\u%}'
but the prompt became empty, like if \u was ignored.
How could ANSI be used as usual within zsh?