Applications that Changed My Life: screen

by Charles Miller on September 23, 2004

Occasionally, an application comes along that changes the way you use your computer. One of those applications that, if you sit down at a computer without it installed, you feel you're working with one hand behind your back.

screen is one such app. Screen is an old-school Unix app that takes control of your terminal (that text-only thing the command line appears in), and uses it to... display a terminal. Which would be rather pointless except that screen can run multiple terminals at once. ctrl-a c creates a new terminal, ctrl-a n switches you forward between terminals, and ctrl-a p switches you back. ctrl-a [number] jumps you straight to a numbered terminal.

This was an absolute god-send back when I was at University, and most of the Internet access came through a DOS full-screen terminal emulator. If you wanted to do more than one thing at a time, you either had to mess with fore- and back-grounding processes, or run screen.

I still find screen essential, even with a GUI that can display as many terminal windows as I want. Like tabbed browsing, screen protects me from an infinite explosion of terminal windows. And unlike tabbed terminals, screen runs in the context of wherever I happen to be ssh'd to, so when I open a new terminal, it's already where I want it to be.

Screen's greatest strength, though, is portability. In Unix, your terminal is irrevocably attached to some session or device. If you log in over a serial line, it's attached to that line. If you telnet or ssh in, your terminal is bound to that telnet or ssh session. In screen, however, all your terminals are owned by the screen process. The session-bound terminal is just being used as a way to display them. Which means screen can detach itself from one terminal, and attach itself to another.

Practically, that meant that for a period of about eight years, I ran my (digital) life through a single screen session. Terminal 0 was tail-ing my procmail logs, so I could see at a glance what email was arriving. Terminal 1 was mutt, where I read my mail. Terminals 2-4 were various IRC networks. 5+ were used for whatever else I happened to be doing at the time.

Wherever I went: home, university, then various jobs, even overseas, I could ssh into satori, my trusty server, run screen -dr to detach the screen from its previous terminal and re-attach it to my current login, and pick up what I was doing precisely where I left off: IRC connections intact, half-written email still waiting for inspiration.

It was like having a virtual computer that I could carry with me, and take out wherever I happened to end up, so long as there was a computer with ssh access. (Random note: many organisations that firewall off every other port will leave ssh open. This is because system administrators are often people like me.) I became an expert at typing "putty download page" into Google, so I could access my life from random Internet cafés.

It speaks wonders for the ongoing usefulness of the text terminal. While you could possibly do the same thing with GUI apps over VNC, the port wouldn't be open, and if it was, the latency would kill you.

These days, however, I am GUI-bound. My portable digital context is the Powerbook. It's prettier, but maybe not quite as convenient: I have to carry it around in a backpack instead of just having it float out there on the ether.

Continued in: Applications that Changed My Life: Quicksilver.

Previously: The Wonderful Thing About Standards...

Next: Applications that Changed My Life: Quicksilver