mirror of
https://github.com/tmux/tmux.git
synced 2025-01-13 03:48:51 +00:00
imsg closes the fd after sending, so dup() STDIN_FILENO before passing it to
the parent, otherwise TIOCGWINSZ will fail when the window is resized (that could actually be moved into the server but this is more future-proof and avoids breaking the protocol).
This commit is contained in:
parent
e0a19abb99
commit
85e8b70625
5
client.c
5
client.c
@ -44,7 +44,7 @@ client_init(char *path, struct client_ctx *cctx, int cmdflags, int flags)
|
|||||||
struct msg_identify_data data;
|
struct msg_identify_data data;
|
||||||
struct winsize ws;
|
struct winsize ws;
|
||||||
size_t size;
|
size_t size;
|
||||||
int fd, mode;
|
int fd, fd2, mode;
|
||||||
char *name, *term;
|
char *name, *term;
|
||||||
char rpathbuf[MAXPATHLEN];
|
char rpathbuf[MAXPATHLEN];
|
||||||
|
|
||||||
@ -119,8 +119,9 @@ server_started:
|
|||||||
if (strlcpy(data.tty, name, sizeof data.tty) >= sizeof data.tty)
|
if (strlcpy(data.tty, name, sizeof data.tty) >= sizeof data.tty)
|
||||||
fatalx("ttyname failed");
|
fatalx("ttyname failed");
|
||||||
|
|
||||||
|
fd2 = dup(STDIN_FILENO);
|
||||||
imsg_compose(&cctx->ibuf, MSG_IDENTIFY,
|
imsg_compose(&cctx->ibuf, MSG_IDENTIFY,
|
||||||
PROTOCOL_VERSION, -1, STDIN_FILENO, &data, sizeof data);
|
PROTOCOL_VERSION, -1, fd2, &data, sizeof data);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
|
Loading…
Reference in New Issue
Block a user