reconfigure method

void reconfigure(
  1. TerminalConfig config
)

Live-apply engine-side config (scrollback, palette, semantic chars, cursor defaults, osc52) without re-spawning. Safe to call repeatedly.

Implementation

void reconfigure(TerminalConfig config) {
  if (_binding == null) {
    // No grid yet — remember the latest config and apply it the moment the
    // binding is built, so the first paint already reflects it.
    _pendingReconfig = config.engineConfig;
    return;
  }
  _binding!.reconfigure(config.engineConfig);
  // A palette change can enqueue a PtyWrite (OSC 997 color-scheme report, for
  // programs subscribed via mode 2031). Flush it now so a live theme toggle
  // reaches an otherwise-idle TUI immediately instead of waiting for output.
  _client!.pumpEventsNow();
  _client!.refreshView();
}