pub struct ProgramConfig {Show 37 fields
pub screen_mode: ScreenMode,
pub ui_anchor: UiAnchor,
pub hyperlink_limit: Option<usize>,
pub budget: FrameBudgetConfig,
pub load_governor: LoadGovernorConfig,
pub diff_config: RuntimeDiffConfig,
pub evidence_sink: EvidenceSinkConfig,
pub render_trace: RenderTraceConfig,
pub frame_timing: Option<FrameTimingConfig>,
pub conformal_config: Option<ConformalConfig>,
pub locale_context: LocaleContext,
pub poll_timeout: Duration,
pub immediate_drain: ImmediateDrainConfig,
pub resize_coalescer: CoalescerConfig,
pub resize_behavior: ResizeBehavior,
pub forced_size: Option<(u16, u16)>,
pub mouse_capture_policy: MouseCapturePolicy,
pub bracketed_paste: bool,
pub focus_reporting: bool,
pub kitty_keyboard: bool,
pub persistence: PersistenceConfig,
pub inline_auto_remeasure: Option<InlineAutoRemeasureConfig>,
pub gestures: Option<GestureConfig>,
pub accessibility: Option<ScreenReaderPolicy>,
pub accessibility_evidence_text: bool,
pub widget_refresh: WidgetRefreshConfig,
pub effect_queue: EffectQueueConfig,
pub guardrails: GuardrailsConfig,
pub intercept_signals: bool,
pub job_control: bool,
pub ctrl_z_suspends: bool,
pub tick_strategy: Option<TickStrategyKind>,
pub runtime_lane: RuntimeLane,
pub rollout_policy: RolloutPolicy,
pub event_coalescing: bool,
pub pixel_mouse: bool,
pub deliver_terminal_responses: bool,
}Expand description
Configuration for the program runtime.
Fields§
§screen_mode: ScreenModeScreen mode (inline or alternate screen).
ui_anchor: UiAnchorUI anchor for inline mode.
hyperlink_limit: Option<usize>Optional maximum distinct hyperlinks admitted per rendered frame.
Retains at most twice this many registry slots so the last presented
frame keeps stable IDs during diffing. Excess links render as plain
text. Models opting in must register URLs on each view, rather than
cache numeric link IDs across frames. None preserves unmanaged IDs;
Some(0) disables link registration. The limit is clamped to half the
24-bit ID space. Applying it to an existing writer invalidates its IDs
and presentation baseline.
budget: FrameBudgetConfigFrame budget configuration.
load_governor: LoadGovernorConfigRuntime load-governor configuration.
diff_config: RuntimeDiffConfigDiff strategy configuration for the terminal writer.
evidence_sink: EvidenceSinkConfigEvidence JSONL sink configuration.
render_trace: RenderTraceConfigRender-trace recorder configuration.
frame_timing: Option<FrameTimingConfig>Optional frame timing sink.
conformal_config: Option<ConformalConfig>Conformal predictor configuration for frame-time risk gating.
locale_context: LocaleContextLocale context used for rendering.
poll_timeout: DurationInput poll timeout.
immediate_drain: ImmediateDrainConfigImmediate event-drain policy for burst handling.
resize_coalescer: CoalescerConfigResize coalescer configuration.
resize_behavior: ResizeBehaviorResize handling behavior (immediate/throttled).
forced_size: Option<(u16, u16)>Forced terminal size override (when set, resize events are ignored).
mouse_capture_policy: MouseCapturePolicyMouse capture policy (Auto, On, Off).
Auto is inline-safe: off in inline modes, on in alt-screen mode.
bracketed_paste: boolEnable bracketed paste.
focus_reporting: boolEnable focus reporting.
kitty_keyboard: boolEnable Kitty keyboard protocol (repeat/release events).
persistence: PersistenceConfigState persistence configuration.
inline_auto_remeasure: Option<InlineAutoRemeasureConfig>Inline auto UI height remeasurement policy.
gestures: Option<GestureConfig>Gesture recognition (clicks, drags, long press, chords) delivered to
Model::on_gesture; None (the default) runs no recognizer.
accessibility: Option<ScreenReaderPolicy>Accessibility tree collection. When set, every rendered frame builds
an A11yTree from the nodes widgets push into the Frame, diffs
it against the previous frame and derives screen-reader
announcements under this policy. Tracing and evidence export metadata
only by default; Model::on_accessibility receives the complete
local announcements. None (the default) collects nothing and adds
no per-frame work.
accessibility_evidence_text: boolInclude announcement text in the explicitly configured evidence sink.
Defaults to false: evidence rows contain "text": null. Enable only
for an intentional local content capture; labels and edited text may
be sensitive. Ordinary tracing never includes announcement content,
and this setting does not change the local accessibility callback.
widget_refresh: WidgetRefreshConfigWidget refresh selection configuration.
effect_queue: EffectQueueConfigEffect queue scheduling configuration.
guardrails: GuardrailsConfigFrame guardrails configuration (memory + queue safety limits).
intercept_signals: boolInstall signal handlers for cleanup on SIGINT/SIGTERM/SIGHUP.
Defaults to true for application safety. Set to false in tests or
when the embedding application manages signals.
job_control: boolHandle job-control stops (SIGTSTP, SIGTTIN, SIGTTOU): hand the terminal
back to the shell before the process stops and restore it, with a full
repaint, when it is continued (docs/spec/suspend-resume.md).
Defaults to true. Takes effect only with intercept_signals
and a backend that can release its terminal session (the native TTY
backend); elsewhere the signals keep their default action, which stops
the process with the terminal still in raw mode.
ctrl_z_suspends: boolTreat a Ctrl-Z key press as a request to suspend (default: false).
Raw mode turns off the terminal’s own Ctrl-Z handling, so the key
arrives as an ordinary event. It is off by default because Ctrl-Z is
undo in TextArea and in the showcase’s editors; with it on, the key
never reaches the model. Requires job_control.
tick_strategy: Option<TickStrategyKind>Optional tick strategy for selective background screen ticking.
When None (default), all screens tick every frame (current behavior).
When set, the runtime consults the strategy for each inactive screen.
runtime_lane: RuntimeLaneRuntime execution lane for the Asupersync migration rollout.
Controls which subscription/effect backend is active.
Defaults to Structured (CancellationToken-backed, current migration state).
Logged at startup so operators can identify the active lane.
rollout_policy: RolloutPolicyRollout policy for the Asupersync migration (bd-2crbt).
Controls whether shadow-run comparison is active during this session.
When Shadow, both the baseline and candidate lanes run in parallel
and evidence is emitted; rendering uses the baseline lane only.
event_coalescing: boolCoalesce high-frequency mouse moves and consecutive same-direction scrolls.
When false (the default), every input event triggers a model update.
When true, mouse move bursts and consecutive same-direction scroll
events are coalesced so intermediate states do not trigger redundant
updates and renders. The recognizer still receives all raw events.
pixel_mouse: boolOpt into SGR-Pixels (DECSET ?1016h) mouse reporting when mouse capture
is enabled (false by default).
deliver_terminal_responses: boolForward Event::TerminalResponse (DCS/APC/XTWINOPS replies) to
Model::update instead of consuming them inside Program (false
by default).
Implementations§
Source§impl ProgramConfig
impl ProgramConfig
Sourcepub fn fullscreen() -> Self
pub fn fullscreen() -> Self
Create config for fullscreen applications.
Sourcepub fn inline_auto(min_height: u16, max_height: u16) -> Self
pub fn inline_auto(min_height: u16, max_height: u16) -> Self
Create config for inline mode with automatic UI height.
Sourcepub fn with_gestures(self, config: GestureConfig) -> Self
pub fn with_gestures(self, config: GestureConfig) -> Self
Run a gesture recognizer over the input stream and deliver recognized
gestures to Model::on_gesture. Mouse gestures need mouse capture
(see Self::with_mouse_capture_policy).
Sourcepub fn with_event_coalescing(self, enabled: bool) -> Self
pub fn with_event_coalescing(self, enabled: bool) -> Self
Coalesce high-frequency mouse moves and consecutive same-direction scrolls.
When enabled, mouse move bursts and same-direction scrolls are coalesced so intermediate positions do not trigger individual model updates and renders. Pending events are flushed at the end of ready event bursts, before non-coalescable events, and on ticks. Raw events are still fed to the gesture recognizer before coalescing.
Sourcepub fn with_pixel_mouse(self, enabled: bool) -> Self
pub fn with_pixel_mouse(self, enabled: bool) -> Self
Opt into SGR-Pixels (DECSET ?1016h) mouse reporting.
Sourcepub fn with_deliver_terminal_responses(self, enabled: bool) -> Self
pub fn with_deliver_terminal_responses(self, enabled: bool) -> Self
Forward Event::TerminalResponse replies to Model::update.
Sourcepub fn with_accessibility(self, policy: ScreenReaderPolicy) -> Self
pub fn with_accessibility(self, policy: ScreenReaderPolicy) -> Self
Build an accessibility tree every frame and derive screen-reader
announcements under policy (see Self::accessibility). Read the
results through Program::accessibility_tree and
Program::accessibility_announcements.
Sourcepub fn with_accessibility_evidence_text(self, include_text: bool) -> Self
pub fn with_accessibility_evidence_text(self, include_text: bool) -> Self
Opt into announcement content in the configured evidence sink.
See Self::accessibility_evidence_text for the privacy contract.
Sourcepub fn with_mouse(self) -> Self
pub fn with_mouse(self) -> Self
Enable mouse support.
Sourcepub fn with_mouse_capture_policy(self, policy: MouseCapturePolicy) -> Self
pub fn with_mouse_capture_policy(self, policy: MouseCapturePolicy) -> Self
Set mouse capture policy.
Sourcepub fn with_mouse_enabled(self, enabled: bool) -> Self
pub fn with_mouse_enabled(self, enabled: bool) -> Self
Force mouse capture enabled/disabled regardless of screen mode.
Sourcepub const fn resolved_mouse_capture(&self) -> bool
pub const fn resolved_mouse_capture(&self) -> bool
Resolve mouse capture using the configured policy and screen mode.
Sourcepub fn with_budget(self, budget: FrameBudgetConfig) -> Self
pub fn with_budget(self, budget: FrameBudgetConfig) -> Self
Set the budget configuration.
Sourcepub fn with_hyperlink_limit(self, limit: usize) -> Self
pub fn with_hyperlink_limit(self, limit: usize) -> Self
Bound per-frame hyperlink admission and retire unused URLs.
See Self::hyperlink_limit for the ID lifetime contract.
Sourcepub fn with_load_governor(self, config: LoadGovernorConfig) -> Self
pub fn with_load_governor(self, config: LoadGovernorConfig) -> Self
Set the runtime load-governor configuration.
Sourcepub fn without_load_governor(self) -> Self
pub fn without_load_governor(self) -> Self
Disable the adaptive load governor and use legacy render-budget behavior.
Sourcepub fn with_diff_config(self, diff_config: RuntimeDiffConfig) -> Self
pub fn with_diff_config(self, diff_config: RuntimeDiffConfig) -> Self
Set the diff strategy configuration for the terminal writer.
Sourcepub fn with_evidence_sink(self, config: EvidenceSinkConfig) -> Self
pub fn with_evidence_sink(self, config: EvidenceSinkConfig) -> Self
Set the evidence JSONL sink configuration.
Sourcepub fn with_render_trace(self, config: RenderTraceConfig) -> Self
pub fn with_render_trace(self, config: RenderTraceConfig) -> Self
Set the render-trace recorder configuration.
Sourcepub fn with_frame_timing(self, config: FrameTimingConfig) -> Self
pub fn with_frame_timing(self, config: FrameTimingConfig) -> Self
Set a frame timing sink for per-frame profiling.
Sourcepub fn with_conformal_config(self, config: ConformalConfig) -> Self
pub fn with_conformal_config(self, config: ConformalConfig) -> Self
Enable conformal frame-time risk gating with the given config.
Sourcepub fn without_conformal(self) -> Self
pub fn without_conformal(self) -> Self
Disable conformal frame-time risk gating.
Sourcepub fn with_locale_context(self, locale_context: LocaleContext) -> Self
pub fn with_locale_context(self, locale_context: LocaleContext) -> Self
Set the locale context used for rendering.
Sourcepub fn with_locale(self, locale: impl Into<Locale>) -> Self
pub fn with_locale(self, locale: impl Into<Locale>) -> Self
Set the base locale used for rendering.
Sourcepub fn with_widget_refresh(self, config: WidgetRefreshConfig) -> Self
pub fn with_widget_refresh(self, config: WidgetRefreshConfig) -> Self
Set the widget refresh selection configuration.
Sourcepub fn with_effect_queue(self, config: EffectQueueConfig) -> Self
pub fn with_effect_queue(self, config: EffectQueueConfig) -> Self
Set the effect queue scheduling configuration.
Sourcepub fn with_resize_coalescer(self, config: CoalescerConfig) -> Self
pub fn with_resize_coalescer(self, config: CoalescerConfig) -> Self
Set the resize coalescer configuration.
Sourcepub fn with_resize_behavior(self, behavior: ResizeBehavior) -> Self
pub fn with_resize_behavior(self, behavior: ResizeBehavior) -> Self
Set the resize handling behavior.
Sourcepub fn with_forced_size(self, width: u16, height: u16) -> Self
pub fn with_forced_size(self, width: u16, height: u16) -> Self
Force a fixed terminal size (cols, rows). Resize events are ignored.
Sourcepub fn without_forced_size(self) -> Self
pub fn without_forced_size(self) -> Self
Clear any forced terminal size override.
Sourcepub fn with_legacy_resize(self, enabled: bool) -> Self
pub fn with_legacy_resize(self, enabled: bool) -> Self
Toggle legacy immediate-resize behavior for migration.
Sourcepub fn with_persistence(self, persistence: PersistenceConfig) -> Self
pub fn with_persistence(self, persistence: PersistenceConfig) -> Self
Set the persistence configuration.
Sourcepub fn with_registry(self, registry: Arc<StateRegistry>) -> Self
pub fn with_registry(self, registry: Arc<StateRegistry>) -> Self
Enable persistence with the given registry.
Sourcepub fn with_inline_auto_remeasure(
self,
config: InlineAutoRemeasureConfig,
) -> Self
pub fn with_inline_auto_remeasure( self, config: InlineAutoRemeasureConfig, ) -> Self
Enable inline auto UI height remeasurement with the given policy.
Sourcepub fn without_inline_auto_remeasure(self) -> Self
pub fn without_inline_auto_remeasure(self) -> Self
Disable inline auto UI height remeasurement.
Sourcepub fn with_signal_interception(self, enabled: bool) -> Self
pub fn with_signal_interception(self, enabled: bool) -> Self
Enable or disable signal interception (SIGHUP/SIGTERM/SIGINT) for cleanup.
Sourcepub fn with_job_control(self, enabled: bool) -> Self
pub fn with_job_control(self, enabled: bool) -> Self
Enable or disable job-control handling (SIGTSTP/SIGTTIN/SIGTTOU).
See ProgramConfig::job_control.
Sourcepub fn with_ctrl_z_suspend(self, enabled: bool) -> Self
pub fn with_ctrl_z_suspend(self, enabled: bool) -> Self
Make a Ctrl-Z key press suspend the program instead of reaching the
model. See ProgramConfig::ctrl_z_suspends.
Sourcepub fn with_guardrails(self, config: GuardrailsConfig) -> Self
pub fn with_guardrails(self, config: GuardrailsConfig) -> Self
Set frame guardrails configuration.
Sourcepub fn with_immediate_drain(self, config: ImmediateDrainConfig) -> Self
pub fn with_immediate_drain(self, config: ImmediateDrainConfig) -> Self
Set the immediate event-drain policy for burst handling.
Sourcepub fn with_tick_strategy(self, strategy: TickStrategyKind) -> Self
pub fn with_tick_strategy(self, strategy: TickStrategyKind) -> Self
Set the tick strategy for selective background screen ticking.
When set, the runtime consults the strategy to decide which inactive screens should tick on each frame. Without a strategy, all screens tick every frame (backwards-compatible default).
ProgramConfig::default()
.with_tick_strategy(TickStrategyKind::Uniform { divisor: 5 })Sourcepub fn with_lane(self, lane: RuntimeLane) -> Self
pub fn with_lane(self, lane: RuntimeLane) -> Self
Set the runtime execution lane.
Sourcepub fn with_rollout_policy(self, policy: RolloutPolicy) -> Self
pub fn with_rollout_policy(self, policy: RolloutPolicy) -> Self
Set the rollout policy for the Asupersync migration.
Sourcepub fn with_env_overrides(self) -> Self
pub fn with_env_overrides(self) -> Self
Apply environment-variable overrides for lane and rollout policy.
Reads FTUI_RUNTIME_LANE and FTUI_ROLLOUT_POLICY. Unset variables
are ignored. Unrecognized values emit a tracing::warn and are
ignored (the programmatic default or prior builder value is retained).