Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My daily workflow includes me

  1. Launching iTerm2
  2. Creating 3 tabs
  3. Setting one tab each to red, orange and yellow
  4. Changing to a specific path in each tab

I would like to script this process; shell, applescript, etc. However, I cannot seem to find a hook that allows me to change the tab color. Is this possible? Here is a screen shot with an example of what I am trying to achieve.

iTerm tab setup

share|improve this question
    
Doesn't Set window title and tab chrome background color help? –  user112553 Mar 22 '12 at 15:38
add comment

1 Answer

up vote 6 down vote accepted

That's possible and you should read iterm escape codes for details.

^[]6;1;bg;red;brightness;N^G

I tried to setup the color of the terminal when I do ssh (.ssh/config) and it worked but surprise, when I close the ssh session, it will not call the script again, in order to restore the title/color.

Added a feature request to auto-colored tabs - do not forget to star it, or add your comments (patches are also welcome!)

share|improve this answer
    
I write an ssh wrapper script in my ~/bin which makes the tab color changes (and other things like custom background with server names) and uses an EXIT trap to change them back. –  Aaron Jun 27 '13 at 18:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.