title: Show current branch on prompt on zsh shell
body: <p>I am trying to display the git branch on prompt on Big Sur.
  So I have created a script file to run for each new session <code>.zshrc</code></p>
  <pre><code># Git branch in prompt.
  parse_git_branch() {
    git branch 2&gt; /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ [\1]/'
  }
  export PS1=&quot;\u@\h \W\[\033[01;33m\]\$(parse_git_branch)\[\033[00m\] $ &quot;
  </code></pre>
  <p>The above doesn't work it actually displays the string not its outpupt.</p>
  <pre><code>\u@\h \W\[\033[01;33m\]$(parse_git_branch)\[\033[00m\] $
  </code></pre>
  <p>How can I show current branch in prompt on zsh shell?</p>