Re:Production is Red, Development is Blue
by olalonde on Monday January 10, 2011 @01:23PM
(#2089238)
Any chance it is possible to accomplish on Ubuntu?
[ Parent
| on HN ]
you could use something like xtermcontrol (http://www.thrysoee.dk/xtermcontrol/) and run it from your ~/.ssh/config file per-host:
Host someproductionbox
LocalCommand xtermcontrol --bg=red
Host sometestbox
LocalCommand xtermcontrol --bg=blueGreat tip! Note that for this to work, you need to edit /etc/ssh/ssh_config and set
PermitLocalCommand yes
There's no way to change profile from the command line using gnome-terminal, unfortunately, but there is "roxterm" which is very similar in functionality and lets you do the following to change the color scheme of the current terminal window:
dbus-send --session /net/sf/roxterm/Options net.sf.roxterm.Options.SetColourScheme string:$ROXTERM_ID "string:NAME_OF_COLOR_SCHEME"Edit your .bashrc in your home directory.
Uncomment 'force_color_prompt=yes' Edit the line following if color_prompt is yes. By default it's green (1;32m). Red is 0;31m.
Make sure to make a copy of the .bashrc file before starting.
The way I prefer to do it in gnome-terminal and konsole (both can do it) is to set up sessions that have the color info in the session for the terminal, and the command to start the session is an ssh command. In konsole, theoretically, you can bind this to a keystroke but there is a long-standing issue with that where it can't seem to persist across restarts, and has weird problems sticking even within a session. But when it works it's convenient, especially when combined with SSH's ControlMaster.
Re:Production is Red, Development is Blue
by lukeschlather on Monday January 10, 2011 @11:58PM
(#2090940)
I have this set in my .bashrc:
function settitle {
echo -en "\e]0; $* \a"
}
function ssh {
settitle ssh $*
echo /usr/bin/ssh $*
/usr/bin/ssh $*
}
function sftp {
settitle sftp $*
echo /usr/bin/ssh $*
/usr/bin/sftp $*
}
No, it's not bright and colorful, but it does a good job of telling me where the gnome-terminal I'm using is connected to.