Looking for a way automatically change terminal colors when ssh-ing into remote machine and revert back to the default colors, when exiting the ssh session. Simply, want have another colors when i'm working on the remote machine.
Any idea?
ps: don't want use iTerm2, but standard Terminal.app
Best Answer
I'm using the following.
Have a shell command, called
myssh
, with content:and use bash aliases for the connect, like:
When I want to ssh into the web server, I simply write
ssweb
in the Terminal and I got the "Homebrew" profile. When the ssh session ends, the AppleScript sets back to the "Basic".The aliases should go into your $HOME/.profile or similar bash-startup file.
The "Homebrew", "Ocean" etc. are the setting profiles from the Terminal.app preferences. You can also set up different fonts, encodings, etc.
Of course, you can use it directly (without aliases) like: