[TriLUG] [Trilug-ontopic] auto-detach for screen?

Jeremy Portzer jeremyp at pobox.com
Mon Nov 19 21:41:55 EST 2007


Cristóbal Palmer wrote:
> Hi folks,
> 
> On our machines we have TMOUT=120 for bash. Once upon a time I found
> this annoying, but it's a cultural norm here that has grown on me to
> the point that I want it elsewhere. Specifically, I want a mechanism
> to send a pow_detach to screen(1) if I've been idle for 7 minutes.
> Anybody know what magic I might put in my ~/.screenrc to get screen to
> do that? If such magic doesn't exist, can someone wiser and more
> bearded suggest a bash trick that would have the same effect?
> 
> If upon arriving home I remember that I've left myself attached at
> work, I can accomplish the same thing by logging into the machine with
> my screen session and issuing 'screen -Dr' (if you're not familiar
> with screen you really should go play with it--it's amazing. :), but I
> don't trust myself, so I want it built in.
> 
> Cheers,


You can simply "always" use 'screen -DR' and it will remote power detach 
if necessary, and reattach.  That's what I do, so it doesn't matter if I 
forgot to detach or not - I don't even need to check.

--Jeremy



More information about the TriLUG mailing list