setNativeFrameCaptureEnabled method

  1. @override
void setNativeFrameCaptureEnabled(
  1. bool enabled
)

Enables native frame capture during subsequent render flushes.

Capture is intentionally opt-in because building native snapshots walks the entire terminal cell buffer and allocates per-cell inspection objects. Callers that need render evidence or interceptor payloads should enable this before rendering, then read the captured values after render.

Implementation

@override
void setNativeFrameCaptureEnabled(bool enabled) {
  if (_captureNativeFrames == enabled) return;
  _captureNativeFrames = enabled;
  if (enabled) {
    _frameStopwatch.stop();
  }
  if (!enabled) {
    _invalidateNativeFrameCache(resetPrevious: true);
  }
}