0

I'm using Mac OS Catalina.

I tried editting .zshrc file with export PS1="\u \w \$ " and my expected output would be user desktop $. However the actual output was \u \w $. I don't understand why \u or \w is not working.

.zshrc file is located in /Users/(username) and I editted the file with VS code. I checked that SHELL=/bin/zsh.

I literally have no idea why this is not working. Any help would be great!

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
23open
  • 11
  • 1

2 Answers2

1

Include that's line in file ~.zshrc :

export PS1="%10F%n%f:%11F%1~%f \$ "

for other options see this site : http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html

ppwater
  • 2,315
  • 4
  • 15
  • 29
0

Literally I spent hours before posting this question, but right after I posted, I found a solution.

zsh seems to use different expansion, darn! http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html

23open
  • 11
  • 1