--- winplink~.c Tue Sep 13 21:44:03 2011 +++ winplink.c Fri Jun 01 17:48:09 2012 @@ -482,6 +482,22 @@ } /* + * Set the dimensions of the terminal according to the console. + */ + { + CONSOLE_SCREEN_BUFFER_INFO csbi; + HANDLE con = CreateFile("CONOUT$", GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, OPEN_EXISTING, 0, 0 ); + if (GetConsoleScreenBufferInfo(con, &csbi)) { + conf_set_int(conf, CONF_width, csbi.dwSize.X); + conf_set_int(conf, CONF_height, csbi.srWindow.Bottom + - csbi.srWindow.Top + 1); + CloseHandle(con); + } + } + + /* * Muck about with the hostname in various ways. */ {