resize method

void resize(
  1. int rows,
  2. int cols, {
  3. int pixelWidth = 0,
  4. int pixelHeight = 0,
})

Resize the pseudo-terminal.

Implementation

void resize(
  int rows,
  int cols, {
  int pixelWidth = 0,
  int pixelHeight = 0,
}) {
  if (_isDestroyed) return;
  validatePtySize(
    rows: rows,
    columns: cols,
    pixelWidth: pixelWidth,
    pixelHeight: pixelHeight,
  );
  final result = _bindings.pty_resize(
    _handle,
    rows,
    cols,
    pixelWidth,
    pixelHeight,
  );
  if (result != 0) {
    final error = _getPtyError() ?? 'Unknown native error';
    throw StateError('Failed to resize PTY: $error');
  }
}