mirror of
https://github.com/tmate-io/tmate-ssh-server.git
synced 2020-11-18 19:53:51 -08:00
Resize bug fix
This commit is contained in:
parent
1cc80546f4
commit
635a198c74
2
client.c
2
client.c
@ -406,9 +406,11 @@ client_signal(int sig, unused short events, unused void *data)
|
||||
client_exitval = 1;
|
||||
client_write_server(MSG_EXITING, NULL, 0);
|
||||
break;
|
||||
#ifndef TMATE_SLAVE
|
||||
case SIGWINCH:
|
||||
client_write_server(MSG_RESIZE, NULL, 0);
|
||||
break;
|
||||
#endif
|
||||
case SIGCONT:
|
||||
memset(&sigact, 0, sizeof sigact);
|
||||
sigemptyset(&sigact.sa_mask);
|
||||
|
@ -1,8 +1,10 @@
|
||||
#include "tmate.h"
|
||||
#include <libssh/libssh.h>
|
||||
#include <libssh/server.h>
|
||||
#include <libssh/callbacks.h>
|
||||
#include <errno.h>
|
||||
#include "tmate.h"
|
||||
|
||||
extern void client_write_server(enum msgtype type, void *buf, size_t len);
|
||||
|
||||
static void consume_channel(struct tmate_ssh_client *client)
|
||||
{
|
||||
@ -63,10 +65,8 @@ static int message_callback(struct tmate_ssh_client *client,
|
||||
ws.ws_col = ssh_message_channel_request_pty_width(msg);
|
||||
ws.ws_row = ssh_message_channel_request_pty_height(msg);
|
||||
|
||||
tmate_debug("change window size to %d, %d",
|
||||
ws.ws_col, ws.ws_row);
|
||||
ioctl(client->pty, TIOCSWINSZ, &ws);
|
||||
kill(getpid(), SIGWINCH);
|
||||
client_write_server(MSG_RESIZE, NULL, 0);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user