diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-10-13 06:14:09 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-10-13 06:14:09 +0000 |
commit | e60a6d8ad37fce3772d57cfa142155d0935446a7 (patch) | |
tree | 65ee5ca2a24b8d582bc322ed40e05bc9bef1008b /usr.bin/tmux/server.c | |
parent | 65e0cbcdb2ca5928c8f7c063da450c542b42b259 (diff) |
When a session is unattached, reset its activity timer to prevent it locking
instantly when reattached.
Diffstat (limited to 'usr.bin/tmux/server.c')
-rw-r--r-- | usr.bin/tmux/server.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.bin/tmux/server.c b/usr.bin/tmux/server.c index ad1bcf5e421..6de31ef2835 100644 --- a/usr.bin/tmux/server.c +++ b/usr.bin/tmux/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.58 2009/10/12 09:29:58 nicm Exp $ */ +/* $OpenBSD: server.c,v 1.59 2009/10/13 06:14:08 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -1377,6 +1377,11 @@ server_lock_server(void) if ((s = ARRAY_ITEM(&sessions, i)) == NULL) continue; + if (s->flags & SESSION_UNATTACHED) { + s->activity = time(NULL); + continue; + } + timeout = options_get_number(&s->options, "lock-after-time"); if (timeout <= 0 || t <= s->activity + timeout) return; /* not timed out */ @@ -1400,6 +1405,11 @@ server_lock_sessions(void) if ((s = ARRAY_ITEM(&sessions, i)) == NULL) continue; + if (s->flags & SESSION_UNATTACHED) { + s->activity = time(NULL); + continue; + } + timeout = options_get_number(&s->options, "lock-after-time"); if (timeout > 0 && t > s->activity + timeout) { server_lock_session(s); |