resize method

void resize(
  1. int cols,
  2. int rows
)

Pins the terminal to an explicit cols×rows (no-op in xterm when unchanged, so it won't spuriously fire a resize event). Guarded like the other JS calls in case it lands on a not-yet-ready or disposed terminal.

Implementation

void resize(int cols, int rows) {
  try {
    _term.resize(cols, rows);
  } on Object {
    // Terminal not ready (or already disposed); a later fit will reconcile.
  }
}