summaryrefslogtreecommitdiffstats
path: root/server-client.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2019-06-20 09:02:26 +0100
committerThomas Adam <thomas@xteddy.org>2019-06-20 09:02:26 +0100
commit03945276f7010a69969714f8b581d68ee9ff92ba (patch)
treee09fa390d09df02ebc31e696bce5db733013ba12 /server-client.c
parentb3ca410bc398e9aa7a045cf1337ca3f08c005e6e (diff)
parentcd1fc42df6d1bacac4f617e031c279ba31bc0632 (diff)
Merge branch 'obsd-master'
Diffstat (limited to 'server-client.c')
-rw-r--r--server-client.c39
1 files changed, 21 insertions, 18 deletions
diff --git a/server-client.c b/server-client.c
index ae41278a..0382b58f 100644
--- a/server-client.c
+++ b/server-client.c
@@ -1948,26 +1948,29 @@ server_client_dispatch_identify(struct client *c, struct imsg *imsg)
close(c->fd);
c->fd = -1;
-
- return;
- }
-
- if (c->fd == -1)
- return;
- if (tty_init(&c->tty, c, c->fd, c->term) != 0) {
- close(c->fd);
- c->fd = -1;
- return;
+ } else if (c->fd != -1) {
+ if (tty_init(&c->tty, c, c->fd, c->term) != 0) {
+ close(c->fd);
+ c->fd = -1;
+ } else {
+ if (c->flags & CLIENT_UTF8)
+ c->tty.flags |= TTY_UTF8;
+ if (c->flags & CLIENT_256COLOURS)
+ c->tty.term_flags |= TERM_256COLOURS;
+ tty_resize(&c->tty);
+ c->flags |= CLIENT_TERMINAL;
+ }
}
- if (c->flags & CLIENT_UTF8)
- c->tty.flags |= TTY_UTF8;
- if (c->flags & CLIENT_256COLOURS)
- c->tty.term_flags |= TERM_256COLOURS;
- tty_resize(&c->tty);
-
- if (!(c->flags & CLIENT_CONTROL))
- c->flags |= CLIENT_TERMINAL;
+ /*
+ * If this is the first client that has finished identifying, load
+ * configuration files.
+ */
+ if ((~c->flags & CLIENT_EXIT) &&
+ !cfg_finished &&
+ c == TAILQ_FIRST(&clients) &&
+ TAILQ_NEXT(c, entry) == NULL)
+ start_cfg();
}
/* Handle shell message. */