NOTE: Yes, This is on Mac OS 11.6.2 Big Sur.
Right now I have zsh aliases in the .zshrc
file to make terminal navigation easier. I thought I'd try to colorize the PWD output, but what happens is that the output is the previous directory. I've added an additional PWD command to show the current directory, but the colorized one is always the last one:
alias goto-config="cd ~/checkouts/trunk/service/configs;pwd;echo -e '\n\e[1;32m $(pwd) \e[0m\n'"
actual input/output:
User.Me % goto--config
/Users/Me/checkouts/trunk/service (this line is standard text color)
/Users/Me/directory/from/which/command/was/called (this line is in color)
expected input/output:
User.Me % goto--config
/Users/Me/checkouts/trunk/service (this line is standard text color)
/Users/Me/checkouts/trunk/service (this line is in color)
So, I'm confused. I thought the echo of the $(pwd) would echo the same directory path as we just navigated to, like it's displayed above. What am I doing wrong?
Thanks!
pwd
correctly prints the directory I'm in aftercd
.&&
instead of;
. Unfortunately I don't have access to a system with MacOS to test different things.