resize method
void
resize()
override
Resize the terminal screen. newWidth
and newHeight
should be greater
than 0. Text reflow is currently not implemented and will be avaliable in
the future.
Implementation
@override
void resize(
int newWidth, int newHeight, int newPixelWidth, int newPixelHeight) {
backend?.resize(newWidth, newHeight, newPixelWidth, newPixelHeight);
newWidth = max(newWidth, 1);
newHeight = max(newHeight, 1);
final oldWidth = _viewWidth;
final oldHeight = _viewHeight;
_viewWidth = newWidth;
_viewHeight = newHeight;
//we need to resize both buffers so that they are ready when we switch between them
_altBuffer.resize(oldWidth, oldHeight, newWidth, newHeight);
_mainBuffer.resize(oldWidth, oldHeight, newWidth, newHeight);
if (buffer == _altBuffer) {
buffer.clearScrollback();
}
_altBuffer.resetVerticalMargins();
_mainBuffer.resetVerticalMargins();
}