1

My .zshrc looks like this:

source /Users/crmpicco/zsh-git-prompt/zshrc.sh
PROMPT="%B%n@MBP%~%b$(git_super_status) %# "

My prompt looks like this:

crmpicco@MBP/var/www/belleisle/symfony(:|✔) %

if I open a new tab in the Terminal the git branch is shown and looks like this (the branch name is "symfony-3-4-30":

crmpicco@MBP/var/www/belleisle/symfony(symfony-3-4-30|✔) %

I'm not sure what has gone wrong, perhaps a MacOS upgrade has knocked this out because it was working well for months.

crmpicco
  • 16,605
  • 26
  • 134
  • 210
  • Do you expect the former (with `:`) to be like the latter? – Adam Jun 15 '20 at 09:11
  • @Adam Yes, I expect the git branch name to display. It seems strange to me it doesn't open in my first tab but does in subsequent tabs. – crmpicco Jun 15 '20 at 09:12
  • I expect when the prompt is resolved during shell initialisation the current directory isn't set properly. – Adam Jun 15 '20 at 09:15
  • @Adam An issue with Zsh? – crmpicco Jun 15 '20 at 09:16
  • Does your `.zshrc` automatically `cd` you into `/var/www/belleisle/symfony`? – Adam Jun 15 '20 at 09:21
  • @Adam No, I don't think so - but it's not my code. This is the contents of the file. https://gist.github.com/crmpicco/9c4b50d9bcc6112870a33084b9c43ea1 – crmpicco Jun 15 '20 at 09:24
  • The command substitution is being evaluated when you define `PROMPT`, not when you display the prompt. Your subsequent tabs are probably being opened with a different working directory (the Git repository), and your `.zshrc` file is defining `PROMPT` anew for each tab. – chepner Jun 15 '20 at 13:16

0 Answers0