Zsh file to add username and machine name?

Viewed 165

I've been looking up how to add username and machine name to my iterm2 terminal. However, what I came across is a bit confusing...

Here's what I wanted it to be:

enter image description here

So I open my ~/.zshrc and then add this code at the end of the file like this?

PROMPT="$fg[magenta]%}$USER@%{$fg[yellow]%}%m ${PROMPT}"

and what should I add before this code?

# Which words?

If this are not the correct steps, then what are the correct steps I need to take to add the name and machine name?

1 Answers

It appears you have a recursive reference, which ensures the prompt will be written twice.

Remove:

${PROMPT}

this won't fix your color problem but it will fix if you are seeing double user written out.

Related