I can find it hard to differentiate between my dev and production server. I am using SSH to connect to the machines (both Ubuntu 10.04), and I was wondering whether there is a way to change the colour of the Terminal window depending on what SSH server it is connected to as I will forget to change the colour for each server...
migrated from serverfault.com May 14 '11 at 21:24
|
This blog post provides a script to solve this problem.
|
||||
|
|
|
In Terminal.app you can change the "theme" per tab (e.g. Pro or Ocean) by right-click on a single tab --> Inspect Tab--> Settings. Also you can use iTerm for it has this option: "Tab labels can change color to indicate the session activities" |
|||
|
|
|
I tried using different colors for different SSH sessions a while back. It didn’t really work out because I would forgot which machine was the red one and which was the blue too easily. I ended up learning myself a few commands that tell you where you are, and who you are there. whoami for example. |
|||
|
|
|
Using iTerm2, you can change the title bar and tab color for each server from the .bashrc on each machine. See the docs for information on this. I combine this with setting the prompt color to make it easy to tell apart. I generally have one iTerm window per server, possible with multiple tabs. This makes it easy to find the right window in Expose. Here is the relevant section of my .cshrc. It would need to be adapted for bash (NOTE: ^] is control+] and ^G is control+G)
endif |
|||
|
|
