Sometimes I find it useful to keep long-running processes in a session of screen.  And sometimes I launch one of said processes outside of screen, and then I yell something like “doh!” or an expletive, because, as I said, I do find screen useful.  Depending on how far the process has gotten, whether it was the sort of operation that would not run happily again, or how much cleanup a second run would require, I either kill the process and restart it or I suspend it with Ctrl+z and send it to the background with bg % so that it doesn’t die when I log off.  The latter is a decent option.  But, darn it, I like screen.

Well, perhaps I’m the last to know, but there’s this neat little tool called retty that allows you to attach running processes to your terminal.  I installed it in Ubuntu Hardy the typical way (sudo apt-get install retty).  So, the next time I screw up, I’ll Ctrl+z, bg it, and then screen retty {PID}.  Voila!

Updated: