Index: curses.c =================================================================== --- curses.c (revision 4290) +++ curses.c (working copy) @@ -39,6 +39,7 @@ static console_ch_t screen[160 * 100]; static WINDOW *screenpad = NULL; +static int term_resizable = 1; static int width, height, gwidth, gheight, invalidate; static int px, py, sminx, sminy, smaxx, smaxy; @@ -98,6 +99,9 @@ if (w == gwidth && h == gheight) return; + if (term_resizable && !is_graphic_console()) + printf("\033[8;%d;%dt", h, w); + gwidth = w; gheight = h; @@ -334,6 +338,7 @@ void curses_display_init(DisplayState *ds, int full_screen) { + const char *term; #ifndef _WIN32 if (!isatty(1)) { fprintf(stderr, "We need a terminal output\n"); @@ -367,6 +372,11 @@ invalidate = 1; + /* check type of console and if it can be resized */ + term = getenv("TERM"); + if (strcmp(term, "linux") == 0) { + term_resizable = 0; + } /* Standard VGA initial text mode dimensions */ curses_resize(ds, 80, 25); }