23open
23open

Reputation: 11

PS1 on .zshrc outputs string instead of desired outputs

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!

Upvotes: 0

Views: 950

Answers (2)

Marco Aurélio
Marco Aurélio

Reputation: 11

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

Upvotes: 1

23open
23open

Reputation: 11

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

Upvotes: 0

Related Questions