summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/server.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/tmux/server.c')
-rw-r--r--usr.bin/tmux/server.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.bin/tmux/server.c b/usr.bin/tmux/server.c
index d7d8f1edb6a..e5787d48f00 100644
--- a/usr.bin/tmux/server.c
+++ b/usr.bin/tmux/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.161 2016/10/15 00:01:01 nicm Exp $ */
+/* $OpenBSD: server.c,v 1.162 2016/10/16 17:55:14 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -190,10 +190,18 @@ static int
server_loop(void)
{
struct client *c;
+ u_int items;
- server_client_loop();
notify_drain();
+ do {
+ items = cmdq_next(NULL);
+ TAILQ_FOREACH(c, &clients, entry)
+ items += cmdq_next(c);
+ } while (items != 0);
+
+ server_client_loop();
+
if (!options_get_number(global_options, "exit-unattached")) {
if (!RB_EMPTY(&sessions))
return (0);