Unconditionally override the configured terminal size with the one
from stdin if it's available. This avoids the silliness whereby if
Default Settings had a terminal size set, Plink used this and thus
caused the server to use the wrong size.
git-svn-id: svn://svn.tartarus.org/sgt/putty@9624
cda61777-01e9-0310-a592-
d414129be87e
int platform_default_i(const char *name, int def)
{
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);
- }
int use_subsystem = 0;
int got_host = FALSE;
long now;
int use_subsystem = 0;
int got_host = FALSE;
long now;
fdlist = NULL;
fdcount = fdsize = 0;
fdlist = NULL;
fdcount = fdsize = 0;
}
putty_signal(SIGWINCH, sigwinch);
}
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);
+ }
+
if (read(signalpipe[0], c, 1) <= 0)
/* ignore error */;
/* ignore its value; it'll be `x' */
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);
}
back->size(backhandle, size.ws_col, size.ws_row);
}