Iterm2 path color setting

15k views Asked by At

I used to be a ubuntu user but switched to Mac recently. I really want to configure the colorscheme of iterm2 to look act like ubuntu default terminal as much as possible.

The biggest problem is I can't configure the color of the current path. in Ubuntu, it is like enter image description here

However, in iterm2, the bobby laptop name and the ~/Documents are the same color when I change the foreground. This is really annoying. It is really painful to look at your file path tangled with the machine name.

2

There are 2 answers

7
Leon Xiong On BEST ANSWER

In iterm2, the bobby laptop name and the ~/Documents are the same color when you change the foreground.

You might adjust the Minimum Contrast to the maximum value.

Just adjust the Minimum Contrast to the middle value.

enter image description here


After some comments, I know you wanna change the PS1 part of bash.

Just use command nano ~/.bash_profile and paste the code to the end of the file:

export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

Restart your terminal to see what happened.

You can adjust the color, the fonts, the text in terminal settings. Then you will get what you want.

For more information, you can search "OS X Terminal Colors".

0
engineerchirag On
  1. Open bash_profile using vi ~/.bash_profile
  2. Add below code:

export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
  1. Optional step, in case you want to hide username in path, replace last line with:

    export PS1="\[\033[33;1m\]\w\[\033[m\]\$ "

  2. Close vi using :wq and run source ~/.bash_profile

  3. In case the colorful path is still not visible verify the Minimum contrast and Cursor Boost setting as shown below. enter image description here