From 0159c74a32dabec337334252121d5d2a060adc21 Mon Sep 17 00:00:00 2001 From: Tiago Cunha Date: Mon, 18 Jun 2012 15:23:01 +0000 Subject: Sync OpenBSD patchset 1138: Add a skeleton mode to tmux (called "control mode") that let's tmux commands be sent and output received on stdout. This can be used to integrate with other terminal emulators and should allow some other things to be made simpler later. More to come so doesn't do much yet and deliberately not documented. --- server-client.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'server-client.c') diff --git a/server-client.c b/server-client.c index d1f72397..a678a122 100644 --- a/server-client.c +++ b/server-client.c @@ -107,6 +107,9 @@ server_client_open(struct client *c, struct session *s, char **cause) struct options *oo = s != NULL ? &s->options : &global_s_options; char *overrides; + if (c->flags & CLIENT_CONTROL) + return (0); + if (!(c->flags & CLIENT_TERMINAL)) { *cause = xstrdup ("not a terminal"); return (-1); @@ -893,6 +896,17 @@ server_client_msg_identify( if (*data->cwd != '\0') c->cwd = xstrdup(data->cwd); + if (data->flags & IDENTIFY_CONTROL) { + c->stdin_callback = control_callback; + c->flags |= (CLIENT_CONTROL|CLIENT_SUSPENDED); + + c->tty.fd = -1; + c->tty.log_fd = -1; + + close(fd); + return; + } + if (!isatty(fd)) return; data->term[(sizeof data->term) - 1] = '\0'; -- cgit