I have recently switched over to iTerm2 and love it. I am wondering though if there is a way to use profiles to correspond to what environment/specific machine you are on.
In my case, I need to combine Yohaï Berreby's answer with my hosts' setting to implement this feature.
- In Automatic Profile Switching, click '+' and add the hostname of your local machine. The hostname is the one you get when running echo $HOST on the target machine. It is not always the one you see in your prompt.
My staging server doesn't set $HOST and host name is :
[devel@alveo-staging ~]$ hostname
alveo-staging
But I can't set the rule with hostname as alveo-staging
. Because in fact alveo-staging is just an alias of the real hostname (alveo-staging.xxx), which can be set in /etc/hosts
.
So the quick solution to this is to use * wildcards, to set the rule as *staging*
.
Then it works.