I got to thinking today that it would be neat if I could place a background image in my Terminal windows. See, I spend 99.9% of my time ssh’ed into other machines. I do all my development remotely on other boxes. It doesn’t really get confusing which box I’m on, but it can take a second to find a different machine, and a lot of times I end up popping a new Terminal and opening a new ssh.
Sure enough, Terminal.app has a background image feature. Thing is, I needed to find a way to automatically change the image based on what machine I ssh’ed into. I started digging around, and holy shit did I find an awesome feature. I had no clue that you can actually save entire Terminal sessions.
You go into Terminal->Window Settings. Make whatever changes you want. In my case I set the name and background image for a particular machine. Close that. File->Save. Select “Execute this command” and enter the ssh command for the host. Say “ssh -l david dellanave.com”. Save the file. Couple this with ssh public key authentication, and I can launch a new Terminal session with a handy background image that automatically connects and logs into the box I want. Hell yes.
And no, this isn’t my normal desktop, I setup one of my side monitors as an example. Too much sensitive stuff on the main display.
If you like what’s here, please follow me on twitter here.
This is a nice feature of Terminal windows, I also like being able to set transparency on them which can be very convenient for development on a smaller screen (plus it’s nice eye candy).
pretty cool, but does it work in X11?
There is a nice program available on Linux and Mac called “screen”. It creates virtual terminals for you. Screen can use one horizontal row on the bottom of your terminal to identify which machine you’re on (just configure .screenrc). I use this application to manage about six terminals during the day. Oh and, you can even split each screen horizontally. Finally, if you close your terminal, screen will keep running and you can reattach to it. Great when you network connection drops.
Regards,
Steve
Nice. I knew about saving the terminal sessions… But what I’ve been trying to do is find a way to connect to multiple ssh servers at launch of Terminal.app. Any idears?
Lets hope it does work in X11.. BTW how damn nice is piping X from a Linux or Unix etc server to your mac..
Us old timers have used this for a while…
### — VT100 escape sequence to set titlebar to hostname
printf “33]0;%s07″ `uname -n | cut -f1 -d.`
You can actually save all sessions too. I have a few .term files that launch a series of windows to one machine (e.g., one tall window on the left, two half sized windows on the right).
Combined w/ Quicksilver, it’s just Cmd-Space foo, return to launch foo.term.
this can be done in gnome for some years now. im glad you found it for OSX
Terminal also accepts XTerm control sequences for setting titles.
I have a simple program that sends the “set window title” string (ESC]2;^G). This allows me to quickly select a window from the window menu.
I have all my remote hosts (and my local one, for that matter) call the program on login (I have a ksh function called ’setwin’ that handles the converting my info (what host I’m on and the tty)).
Useful stuff, thanks man.
Too bad iTerm does the same exact thing… and you get tabs.
I’ve found making a different colour background for each server helps heaps.
bla.st/mac-software/
“too much sensitive stuff on my main display” – hey I’ve got an Awesome OS X Feature for you too – it’s called minimize!
Showing off that you have more than one display is pretty sad.
depends on the terminal. aterm does this since long ago
http://www.afterstep.org/aterm.php
That’s very cool. And, I’d like to add, your backgrounds for disambiguating sessions are practically identical to my backgrounds for disambiguating my various virtual desktop zones.
We’re connected somewhere, through sub-Finder space.
[...] read more | digg story Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages. [...]
Cool, nice find.
You can do that with any terminal emulator. Its isn’t amazing at all…
Most people don’t know that you can drag a file into the window and the escaped path will be printed
A few notes:
1) first of all, rather than ’ssh -l user example.com’, you can say ’ssh user@example.com‘
2) you can also color your terminals with the process described here: http://apple.newbox.org/article.php?story=colorful_terminal
3) a benefit of coloring them, rather than using a grey-and-black picture, is that you can tell which is which even when they’re minimized.
4) also, coloring terminals as described above doesn’t require any window settings–just type in the command and the session starts and the proper color appears. So you can log out of one box, log into another, and everything is colored correctly–no need to open a new window.
I just use iTerm (http://iterm.sourceforge.net/) Tabs rock..
[...] This guy has each Mac OS X Terminal window with a custom background, but it would mean I would have to open ssh connections using saved sessions, which I don’t want to do. As well, I suspect that after you log out, the window background will still be set for the remote server. I like the idea, but not the implementation. If there was a way to manipulate the current Terminal window from the command line, then I’d just write a wrapper script for ssh that automagically changes the background to and from the server being connected to (but I haven’t found a way of doing this). [...]
I see someone here is afraid to show that he’s chatting…
Thanks for sharing! cool feature.
[...] to use background images and other awesome features built into Mac O SX terminal.read more | digg [...]
I would imagine that this is terminal.app dependent rather than X11.
Matt,
If you didn’t see below, you can save a bunch of Terminals too, rather than just one.
I use screen as well religiously, but it doesn’t do the same thing for me as being able to launch Terms with a file.
The X11.app on Mac OS X works fairly well (Optional Install from the installation DVD). I use a PowerMac G5 as my workstation and develop Linux kernel software, so I’m constantly exporting X-Window sessions back to my Mac (mostly things like xload, gvim and TightVNC).
Dealing with copy/paste issues can be a bit interesting. It is important to read the X11.app Preferences on how to map mouse clicks to get the most out of X11 on Mac OS X.
Bob Harris