9

I need to have different color schemes for each of the two terminal types I use. I can set it in the .bash_profile as mentioned here. But how can I tell it to differ depending whether its a iTerm2 or default terminal instance?

15

There is an environment variable set by iTerm and by Terminal as the following:

for Terminal:

TERM_PROGRAM=Apple_Terminal

for iTerm:

TERM_PROGRAM=iTerm.app

You should see this variable by typing in env from the command line.

So - using this variable, you can put a condition in your .bash_profile file to select the proper coloring.

  • or just run echo $TERM_PROGRAM – Eliran Malka Jul 31 '16 at 11:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .