scheduleWrite method
Coalesce PTY-bound bytes (TUI scroll, batched arrows) to one output event per scheduling tick — same hop model as scroll coalescing.
Implementation
void scheduleWrite(Uint8List bytes) {
if (_disposed || _outputCtl.isClosed || bytes.isEmpty) return;
_pendingWrite.add(bytes);
if (_writeFlushScheduled) return;
_writeFlushScheduled = true;
_schedule(_flushPendingWrite);
}