tui: send resize sequences to the terminal

Neither setting the 'columns' and 'lines' options nor using the
`:winsize` command resized the terminal window, which caused display
glitches.

Re: #2863
This commit is contained in:
Felipe Morales 2015-07-18 17:13:01 -03:00 committed by Justin M. Keyes
parent 6571c84d54
commit 6048e95f33

View File

@ -350,6 +350,11 @@ static void tui_resize(UI *ui, int width, int height)
data->scroll_region.left = 0;
data->scroll_region.right = width - 1;
data->row = data->col = 0;
// try to resize the terminal window
char r[16]; // enough for 9999x9999
snprintf(r, sizeof(r), "\x1b[8;%d;%dt", height, width);
out(ui, r, strlen(r));
}
static void tui_clear(UI *ui)