Terminal background color per server
I just changed the config of my application and tested it if it still works, since I only switched DB names. Everything is cool. It works, all the pages show the same stuff it seems to work. Great thing!
A couple minutes later, I go to the shell window where I did that change and am wondering what server I am on. Geeeeeeee, the online version. I changed the DB to use on the live version. God damn it.
It was no big deal, since I hadn’t restarted the server yet, since my local dev server (django) automatically restarts when I change any python file. So I just undid the change online.
Something has to change that this won’t happen again, searching the web a bit and with the help of Daniel I found this article “Colorful Terminal”, where he had solved the same problem. Great solution.
Just one little thing, when I accidently forget to start the script which logs me into the server and changes the background color of my terminal … what then? Can the script not trigger on “ssh me@server.com”? Any ideas?
Daniel Lange said,
November 14, 2007 at 12:42 pm
Part 1)
see here: http://bbs.applescript.net/viewtopic.php?id=22935
Part 2)
tell application “Terminal”
activate
do script “ssh me@server.com”
end tell
fa said,
November 14, 2007 at 4:08 pm
mhm, klingt gut - aber eigentlich bin ich die letzten Jahre sehr gut mit eingefärbtem
(user@host) $
via .bashrc gefahren und hab nix kaputtgemacht. Zugegeben, wenn man im vim o.ä. steckt, könnte es hilfreich sein…
Wolfram said,
November 14, 2007 at 5:20 pm
this is the script I have in my /usr/local/bin/ssh-servername
#!/bin/bash
osascript -e ‘tell app “Terminal” to set background color of first window to {17655, 0, 0, -16373}’
ssh me@server.com
osascript -e ‘tell app “Terminal” to set background color of first window to {0, 0, 0, -16373}’
it sets the bgcolor to a red (with transparency as i like it) when i go on the server and to black transparent when i am local
wolfram