X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=unix%2Fuxplink.c;h=61b9426bb8823e2a5534cba9e4975aab62e5cadc;hb=df83634e21d9442210ed244c9b4ff1a0c3fbd983;hp=77c46a4d8ab870fb2f0026e100f1014d80b66adb;hpb=aba05b7180b39ee51d72b1da867303c002188f2c;p=PuTTY.git diff --git a/unix/uxplink.c b/unix/uxplink.c index 77c46a4d..61b9426b 100644 --- a/unix/uxplink.c +++ b/unix/uxplink.c @@ -116,12 +116,6 @@ char *platform_default_s(const char *name) int platform_default_i(const char *name, int def) { - if (!strcmp(name, "TermWidth") || - !strcmp(name, "TermHeight")) { - struct winsize size; - if (ioctl(STDIN_FILENO, TIOCGWINSZ, (void *)&size) >= 0) - return (!strcmp(name, "TermWidth") ? size.ws_col : size.ws_row); - } return def; } @@ -600,6 +594,7 @@ int main(int argc, char **argv) int use_subsystem = 0; int got_host = FALSE; long now; + struct winsize size; fdlist = NULL; fdcount = fdsize = 0; @@ -902,6 +897,15 @@ int main(int argc, char **argv) } putty_signal(SIGWINCH, sigwinch); + /* + * Now that we've got the SIGWINCH handler installed, try to find + * out the initial terminal size. + */ + if (ioctl(STDIN_FILENO, TIOCGWINSZ, &size) >= 0) { + conf_set_int(conf, CONF_width, size.ws_col); + conf_set_int(conf, CONF_height, size.ws_row); + } + sk_init(); uxsel_init(); @@ -1057,7 +1061,7 @@ int main(int argc, char **argv) if (read(signalpipe[0], c, 1) <= 0) /* ignore error */; /* ignore its value; it'll be `x' */ - if (ioctl(0, TIOCGWINSZ, (void *)&size) >= 0) + if (ioctl(STDIN_FILENO, TIOCGWINSZ, (void *)&size) >= 0) back->size(backhandle, size.ws_col, size.ws_row); }