Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to set Terminal to use a different theme for remote connections. I often have several Terminal windows open at once for both local and remote work and it would be really handy to have the remote connections shown in a different color.

For example, Terminals for the local environment would be in Homebrew. Terminals connected to Server A would be Man Page and Terminals connected to Server B would be Red Sands.

I'm happy to work with hacky/workaround methods, I just can't find anything about this.

share|improve this question
when I ssh onto my remote machine under, the console adapts its color scheme to the remote clients theme. my ubuntu console is white on black, my gentoo remote box is actually more colorful ;) not an answer though cause i don't know how to actively archive that, but since osX is very similar to linux there might be a way. – Baarn Jul 28 '11 at 12:30
1 I made a screenshot, maybe this is what you are looking for. (lower console is ssh) – Baarn Jul 28 '11 at 12:40
Thanks for the reply. I can't see anything in Terminal that would achieve anything like that as it seems keen on imposing its own theme - I'd be very happy with this if I could have a different theme per connection or window but I just can't find a way of doing it. – SaucyK Jul 28 '11 at 12:50
up vote 2 down vote accepted

I´d suggest duplicating the existing themes you want to use, renaming them to the Server´s names and have the new themes execute a custom shell command (in this case ssh) on startup (this can be configured in the theme preferences within the "shell" tab). This way these new themes will appear in the "Shell" > "New Window" menu, so that you could even assign them a shortcut (e.g. cmd+alt+a for server "A" and so on).

Another way would be to create a shell script that executes an applescript which then changes the theme in the current window and executes ssh afterwards; but I´m not sure at the moment how to reset the theme once you´re finished.

Your last option would be to configure differently coloured PS1 prompts on each server you ssh into, this is what I usually do.

share|improve this answer
The script on startup is perfect, thank you very much! – SaucyK Jul 28 '11 at 15:54

im a sysadmin, and i ssh into a tonne of boxes on the daily.

ive got a nice little script that will automagically set the background color of the terminal window based on the hostname of the remote host. when you disconnect, it reverts.

all you need to do is: cssh [remotehost]

if you wanted to be fancy, you could alias cssh->ssh and then it would be default behavior, but i only invoke the colors when i need to.

hope this helps!

pastebin link to the script:

share|improve this answer
That's a great script. – Chris Page Sep 26 '11 at 14:51
nice one. love it! – fluxsaas Jun 7 '12 at 12:09
This is great. Does anyone know that the default OSX colour schemes are? Is there a way to emulate the translucency that OSX provides? – ken Jun 13 '13 at 12:54

You must log in to answer this question.

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