mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 13:37:12 +00:00
Move the call to setupterm() into the client and have it pass the
results to the server over imsg, means the server does not need to enter ncurses or read terminfo db. Old clients will not work with a new server.
This commit is contained in:
@ -307,6 +307,7 @@ server_client_lost(struct client *c)
|
||||
|
||||
free(c->term_name);
|
||||
free(c->term_type);
|
||||
tty_term_free_list(c->term_caps, c->term_ncaps);
|
||||
|
||||
status_free(c);
|
||||
|
||||
@ -1997,16 +1998,17 @@ server_client_dispatch(struct imsg *imsg, void *arg)
|
||||
datalen = imsg->hdr.len - IMSG_HEADER_SIZE;
|
||||
|
||||
switch (imsg->hdr.type) {
|
||||
case MSG_IDENTIFY_CLIENTPID:
|
||||
case MSG_IDENTIFY_CWD:
|
||||
case MSG_IDENTIFY_ENVIRON:
|
||||
case MSG_IDENTIFY_FEATURES:
|
||||
case MSG_IDENTIFY_FLAGS:
|
||||
case MSG_IDENTIFY_LONGFLAGS:
|
||||
case MSG_IDENTIFY_TERM:
|
||||
case MSG_IDENTIFY_TTYNAME:
|
||||
case MSG_IDENTIFY_CWD:
|
||||
case MSG_IDENTIFY_STDIN:
|
||||
case MSG_IDENTIFY_STDOUT:
|
||||
case MSG_IDENTIFY_ENVIRON:
|
||||
case MSG_IDENTIFY_CLIENTPID:
|
||||
case MSG_IDENTIFY_TERM:
|
||||
case MSG_IDENTIFY_TERMINFO:
|
||||
case MSG_IDENTIFY_TTYNAME:
|
||||
case MSG_IDENTIFY_DONE:
|
||||
server_client_dispatch_identify(c, imsg);
|
||||
break;
|
||||
@ -2200,6 +2202,14 @@ server_client_dispatch_identify(struct client *c, struct imsg *imsg)
|
||||
c->term_name = xstrdup(data);
|
||||
log_debug("client %p IDENTIFY_TERM %s", c, data);
|
||||
break;
|
||||
case MSG_IDENTIFY_TERMINFO:
|
||||
if (datalen == 0 || data[datalen - 1] != '\0')
|
||||
fatalx("bad MSG_IDENTIFY_TERMINFO string");
|
||||
c->term_caps = xreallocarray(c->term_caps, c->term_ncaps + 1,
|
||||
sizeof *c->term_caps);
|
||||
c->term_caps[c->term_ncaps++] = xstrdup(data);
|
||||
log_debug("client %p IDENTIFY_TERMINFO %s", c, data);
|
||||
break;
|
||||
case MSG_IDENTIFY_TTYNAME:
|
||||
if (datalen == 0 || data[datalen - 1] != '\0')
|
||||
fatalx("bad MSG_IDENTIFY_TTYNAME string");
|
||||
|
Reference in New Issue
Block a user