This commit is contained in:
David Aguilar 2023-01-18 05:30:50 +00:00 committed by GitHub
commit 91de967e21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -79,6 +79,8 @@ typedef struct {
struct {
uint16_t rows;
uint16_t cols;
uint16_t xpixels;
uint16_t ypixels;
} ws;
uint32_t i;
uint64_t l;
@ -677,6 +679,8 @@ int main(int argc, char *argv[]) {
if (ioctl(STDIN_FILENO, TIOCGWINSZ, &server.winsize) == -1) {
server.winsize.ws_col = 80;
server.winsize.ws_row = 25;
server.winsize.ws_xpixel = 640;
server.winsize.ws_ypixel = 480;
}
server.read_pty = (action == 'n');

View File

@ -81,7 +81,7 @@ static int client_mainloop(void) {
if (ioctl(STDIN_FILENO, TIOCGWINSZ, &ws) != -1) {
Packet pkt = {
.type = MSG_RESIZE,
.u = { .ws = { .rows = ws.ws_row, .cols = ws.ws_col } },
.u = { .ws = { .rows = ws.ws_row, .cols = ws.ws_col, .xpixels = ws.ws_xpixel, .ypixels = ws.ws_ypixel } },
.len = sizeof(pkt.u.ws),
};
if (client_send_packet(&pkt))

View File

@ -234,6 +234,8 @@ static void server_mainloop(void) {
struct winsize ws = { 0 };
ws.ws_row = client_packet.u.ws.rows;
ws.ws_col = client_packet.u.ws.cols;
ws.ws_xpixel = client_packet.u.ws.xpixels;
ws.ws_ypixel = client_packet.u.ws.ypixels;
ioctl(server.pty, TIOCSWINSZ, &ws);
}
kill(-server.pid, SIGWINCH);