write method
View → engine (keystrokes, paste bytes, mouse reports). Bytes appear on
output in the same tick — single ordered sink with Event::PtyWrite.
Implementation
void write(Uint8List bytes) {
// Both checks have distinct roles: `_disposed` is set before
// `_outputCtl.close()` in [dispose], so it guards calls racing with
// dispose; `isClosed` guards against the (currently unreachable, but
// cheap) case where the controller is closed independently. Together they
// make the path safe regardless of dispose order.
if (_disposed || _outputCtl.isClosed) return;
_outputCtl.add(bytes);
}