mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 05:21:10 +00:00
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.
This commit is contained in:
@ -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';
|
||||
|
Reference in New Issue
Block a user