March 07, 2006

An old screen wrinkle

If you do a lot of terminal work and don't use screen, it could be worth your while to investigate. A lot of people (old timers and new comers alike) don't know anything about it. I don't recall it being included in any of the older unix guides (and it may not be there today). Often enough, if you know about screen, someone told you about it at some point. Term I was just telling a coworker last week about how to use screen to deal with some unit tests that are starting to run nearly 30 minutes (run screen on a server, start the test, detach, come back later). Screen is worth passing on.

Created by Oliver Laumann in 1987, it was the virtual window manager of it's day (there weren't many windows around, just terminal connections). This history of screen covers the creation and a bit about the evolution of the development community. What's fascinating is how useful a (nearly) twenty year old tool created to deal with a pure text world can be.

Whenever new articles about screen pop up, I read them and usually pick up something useful. That was the case last night. While catching up on some neglected feeds I noticed Ask's Guide to a happier unix life - screen which had a comment linking to this intro to screen.

The intro article covers a significant amount of ground in short space. It also has some basic .screenrc stuff at the end, similar to what I was already using but missed a few things I was hoping to find more information about. It did refer me back to the original package for more examples, which was the real value. I'd never downloaded the source directly, either finding it installed, installing a packaged version or installing via a package manager. The source package was where I found a relatively complete .screenrc example for users which sent me back to the man page and answered some lingering questions.

  • Like setting up screen sessions in a few specific directories (sprinkle 'chdir' directives before the screen creation commands) and changing the default directory for all new screen sessions.

    Making the last directive be 'chdir /tmp/' takes care of that.

  • How to kill all existing screens at once.

    (C-a \)

As always, answers lead to new questions that I'll get to someday.

One final detail for the absent minded (or lazy like me). I can never remember if I've already set up a screen world on a particular system or not, so I wound up using a script named scr that automatically connects to the last screen session (if any exist) or starts screen:

#!/bin/sh

screen -R

Posted by Dave at March 7, 2006 10:43 PM
Trackback URL: http://homie.dijas.com/mt/mt-tb.cgi/548
Comments