diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2013-10-20 17:28:44 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2013-10-20 17:28:44 +0000 |
commit | 1448a873f1bd167ba0f78ab0f1f7d23b3c96d079 (patch) | |
tree | 2b49f2ac97e842ea50ad2e51aa34de7ef735dfc7 /usr.bin/tmux/cfg.c | |
parent | 07fdf45076fd0bbf9113cac691ff11bcecd4b6b7 (diff) |
Do not run any command line command from the client which starts the
server until after the configuration file completes. This prevents it
racing against run-shell or if-shell in .tmux.conf that run in the
background.
Diffstat (limited to 'usr.bin/tmux/cfg.c')
-rw-r--r-- | usr.bin/tmux/cfg.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/usr.bin/tmux/cfg.c b/usr.bin/tmux/cfg.c index fc7bbfe9011..4521e7eb336 100644 --- a/usr.bin/tmux/cfg.c +++ b/usr.bin/tmux/cfg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cfg.c,v 1.29 2013/03/25 10:06:13 nicm Exp $ */ +/* $OpenBSD: cfg.c,v 1.30 2013/10/20 17:28:43 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> @@ -31,6 +31,7 @@ struct cmd_q *cfg_cmd_q; int cfg_finished; int cfg_references; struct causelist cfg_causes; +struct client *cfg_client; int load_cfg(const char *path, struct cmd_q *cmdq, char **cause) @@ -127,6 +128,20 @@ cfg_default_done(unused struct cmd_q *cmdq) cmdq_free(cfg_cmd_q); cfg_cmd_q = NULL; + + if (cfg_client != NULL) { + /* + * The client command queue starts with client_exit set to 1 so + * only continue if not empty (that is, we have been delayed + * during configuration parsing for long enough that the + * MSG_COMMAND has arrived), else the client will exit before + * the MSG_COMMAND which might tell it not to. + */ + if (!TAILQ_EMPTY(&cfg_client->cmdq->queue)) + cmdq_continue(cfg_client->cmdq); + cfg_client->references--; + cfg_client = NULL; + } } void |