Holy Crap I Found an Awesome OS X Feature

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.

Sexworld Minneapolis

RSS feed

28 Comments

Comment by David Mendez
2007-04-27 22:56:38

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).

 
Comment by Justin
2007-04-27 22:57:08

pretty cool, but does it work in X11?

Comment by gerryk
2007-04-28 03:06:32

I would imagine that this is terminal.app dependent rather than X11.

 
 
Comment by Steve
2007-04-27 23:47:39

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

 
Comment by Matt Peters
2007-04-28 00:13:34

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? :D

Comment by david
2007-04-28 08:56:48

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.

 
 
Comment by Andrew Kneebone
2007-04-28 00:30:41

Lets hope it does work in X11.. BTW how damn nice is piping X from a Linux or Unix etc server to your mac..

Comment by Bob Harris
2007-04-28 20:43:59

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

 
 
Comment by Lex
2007-04-28 01:25:27

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.`

 
Comment by Bill
2007-04-28 01:31:18

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.

 
Comment by sancho
2007-04-28 01:48:47

this can be done in gnome for some years now. im glad you found it for OSX

 
Comment by Sean
2007-04-28 02:02:34

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)).

 
Comment by Teemu
2007-04-28 02:44:38

Useful stuff, thanks man.

 
Comment by Yvo
2007-04-28 03:00:30

Too bad iTerm does the same exact thing… and you get tabs.

 
Comment by Tim
2007-04-28 03:16:50

I’ve found making a different colour background for each server helps heaps.

bla.st/mac-software/

 
Comment by -
2007-04-28 04:55:41

“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.

 
Comment by francisg
2007-04-28 04:56:03

depends on the terminal. aterm does this since long ago ;)

http://www.afterstep.org/aterm.php

 
Comment by Cheeseburger Brown
2007-04-28 05:31:02

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.

 
2007-04-28 09:33:18

[...] read more | digg story Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages. [...]

 
Comment by speedmaster
2007-04-28 12:54:36

Cool, nice find.

 
Comment by Justin
2007-04-30 16:23:53

You can do that with any terminal emulator. Its isn’t amazing at all…

 
Comment by bigkm
2007-04-30 16:48:55

Most people don’t know that you can drag a file into the window and the escaped path will be printed

 
Comment by brian
2007-04-30 19:17:44

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.

 
Comment by Big Dave
2007-05-01 10:18:14

I just use iTerm (http://iterm.sourceforge.net/) Tabs rock..

 
2007-05-03 11:07:50

[...] 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). [...]

 
Comment by maurizio
2007-05-10 01:27:38

I see someone here is afraid to show that he’s chatting… :-)

 
Comment by spy phone
2007-05-22 07:30:35

Thanks for sharing! cool feature.

 
2007-05-28 03:35:20

[...] to use background images and other awesome features built into Mac O SX terminal.read more | digg [...]

 

Sorry, the comment form is closed at this time.