unsafe void CheckWindowDimensions ()
{
if (native_terminal_size == null || terminal_size == *native_terminal_size)
return;
if (*native_terminal_size == -1){
int c = reader.Get (TermInfoNumbers.Columns);
if (c != 0)
windowWidth = c;
c = reader.Get (TermInfoNumbers.Lines);
if (c != 0)
windowHeight = c;
} else {
terminal_size = *native_terminal_size;
windowWidth = terminal_size >> 16;
windowHeight = terminal_size & 0xffff;
}
bufferHeight = windowHeight;
bufferWidth = windowWidth;
}