sendTerminalBytes method

void sendTerminalBytes(
  1. List<int> bytes, {
  2. bool flush = false,
})

Feeds terminal bytes through a persistent parser and the input dispatcher. UTF-8, escape sequences and bracketed paste can span calls. Set flush only when simulating the terminal driver's ambiguity timeout (for example, a standalone Escape); read boundaries do not flush automatically.

This does not emulate a terminal driver or negotiate capabilities. Use keyboardCapabilities for that contract and pump to render. A custom terminalParser constructor argument can set parser limits for probes.

Implementation

void sendTerminalBytes(List<int> bytes, {bool flush = false}) {
  _assertNotDisposed('sendTerminalBytes');
  _openFrame();
  final parser = _terminalParser ??= InputParser();
  final sink = _TesterTerminalSink((event) => _dispatcher.dispatch(event));
  parser.feed(bytes, sink);
  if (flush) parser.flush(sink);
  _owner.flushBuild();
}