resize method

void resize(
  1. int newWidth,
  2. int newHeight
)

Resizes the buffer to newWidth by newHeight terminal cells.

Implementation

void resize(int newWidth, int newHeight) {
  _checkValid();
  // Validate dimensions - match Go's validation pattern
  if (newWidth <= 0 || newHeight <= 0) {
    throw ArgumentError(
      'Invalid dimensions: width and height must be greater than 0',
    );
  }
  _bindings.bufferResize(_ptr, newWidth, newHeight);
}