'I can't figure out how to configure the colors of my iTerm2 terminal

I'm currently on MacOs and using iTerm2 as my main terminal and I want to change the colors of the username and current folder to easily differentiate them from the commands.

I already figured that I needed to create a .zshrc file and write PS1= in it.

Online I found these answers:

This one gives me green user, white @, green host, and cyan current folder.

PS1='%{%F{green}%}%n%{%f%}%{%F{white}%}@%{%f%}%{%F{green}%}%m %{%F{cyan}%}%1~ %{%f%}%% '

This one gives me cyan user, white @, green host, and yellow bold current folder.

PS1=$'\033[36m%n\033[m@\033[32m%m:\033[33;1m%~\033[m\$'

I feel stupid but I can't quite figure out the syntax to these in order to make their changes I want. Everytime I try something it just end up not showing or showing as plain text. Can anyone point me out in the right direction on how to learn about this?

I just want to copy the colors of the ubuntu terminal - bold light green user@host and bold light blue current folder.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source