invalidate method

  1. @override
void invalidate()
override

Resets internal diff / cache state so the next render call produces a full redraw, without performing any terminal I/O.

Unlike clear, which may write escape sequences to the terminal and trigger stdout flushes, invalidate only touches in-memory state. This makes it safe to call from contexts (like hot reload reassembly) where the subsequent render should go through the normal message-queue pipeline rather than rendering directly.

Implementation

@override
void invalidate() {
  _initialize();
  _renderer?.erase();
  // Discard any ESC[2J queued by erase() into the inline capture buffer.
  if (_options.isInline) _inlineCapture.clear();
  _dirty = true;
  _invalidateNativeFrameCache(resetPrevious: true);
  // Stop the stopwatch to force next render to proceed past frame-rate
  // limiting, but do NOT flush the terminal — the caller will trigger a
  // render through the normal message-queue pipeline.
  _frameStopwatch.stop();
  _pendingView = '';
}