=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/server.c,v retrieving revision 1.93 retrieving revision 1.94 diff -u -r1.93 -r1.94 --- src/usr.bin/tmux/server.c 2010/09/26 18:51:48 1.93 +++ src/usr.bin/tmux/server.c 2010/09/26 20:43:30 1.94 @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.93 2010/09/26 18:51:48 nicm Exp $ */ +/* $OpenBSD: server.c,v 1.94 2010/09/26 20:43:30 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -222,15 +222,17 @@ } } -/* Check if the server should be shutting down (no more clients or windows). */ +/* Check if the server should be shutting down (no more clients or sessions). */ int server_should_shutdown(void) { u_int i; - for (i = 0; i < ARRAY_LENGTH(&sessions); i++) { - if (ARRAY_ITEM(&sessions, i) != NULL) - return (0); + if (!options_get_number(&global_options, "exit-unattached")) { + for (i = 0; i < ARRAY_LENGTH(&sessions); i++) { + if (ARRAY_ITEM(&sessions, i) != NULL) + return (0); + } } for (i = 0; i < ARRAY_LENGTH(&clients); i++) { if (ARRAY_ITEM(&clients, i) != NULL)