Skip to main content

ProgramConfig

Struct ProgramConfig 

Source
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: ScreenMode

Screen mode (inline or alternate screen).

§ui_anchor: UiAnchor

UI 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: FrameBudgetConfig

Frame budget configuration.

§load_governor: LoadGovernorConfig

Runtime load-governor configuration.

§diff_config: RuntimeDiffConfig

Diff strategy configuration for the terminal writer.

§evidence_sink: EvidenceSinkConfig

Evidence JSONL sink configuration.

§render_trace: RenderTraceConfig

Render-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: LocaleContext

Locale context used for rendering.

§poll_timeout: Duration

Input poll timeout.

§immediate_drain: ImmediateDrainConfig

Immediate event-drain policy for burst handling.

§resize_coalescer: CoalescerConfig

Resize coalescer configuration.

§resize_behavior: ResizeBehavior

Resize handling behavior (immediate/throttled).

§forced_size: Option<(u16, u16)>

Forced terminal size override (when set, resize events are ignored).

§mouse_capture_policy: MouseCapturePolicy

Mouse capture policy (Auto, On, Off).

Auto is inline-safe: off in inline modes, on in alt-screen mode.

§bracketed_paste: bool

Enable bracketed paste.

§focus_reporting: bool

Enable focus reporting.

§kitty_keyboard: bool

Enable Kitty keyboard protocol (repeat/release events).

§persistence: PersistenceConfig

State 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: bool

Include 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: WidgetRefreshConfig

Widget refresh selection configuration.

§effect_queue: EffectQueueConfig

Effect queue scheduling configuration.

§guardrails: GuardrailsConfig

Frame guardrails configuration (memory + queue safety limits).

§intercept_signals: bool

Install 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: bool

Handle 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: bool

Treat 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: RuntimeLane

Runtime 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: RolloutPolicy

Rollout 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: bool

Coalesce 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: bool

Opt into SGR-Pixels (DECSET ?1016h) mouse reporting when mouse capture is enabled (false by default).

§deliver_terminal_responses: bool

Forward Event::TerminalResponse (DCS/APC/XTWINOPS replies) to Model::update instead of consuming them inside Program (false by default).

Implementations§

Source§

impl ProgramConfig

Source

pub fn fullscreen() -> Self

Create config for fullscreen applications.

Source

pub fn inline(height: u16) -> Self

Create config for inline mode with specified height.

Source

pub fn inline_auto(min_height: u16, max_height: u16) -> Self

Create config for inline mode with automatic UI height.

Source

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).

Source

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.

Source

pub fn with_pixel_mouse(self, enabled: bool) -> Self

Opt into SGR-Pixels (DECSET ?1016h) mouse reporting.

Source

pub fn with_deliver_terminal_responses(self, enabled: bool) -> Self

Source

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.

Source

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.

Source

pub fn with_mouse(self) -> Self

Enable mouse support.

Source

pub fn with_mouse_capture_policy(self, policy: MouseCapturePolicy) -> Self

Set mouse capture policy.

Source

pub fn with_mouse_enabled(self, enabled: bool) -> Self

Force mouse capture enabled/disabled regardless of screen mode.

Source

pub const fn resolved_mouse_capture(&self) -> bool

Resolve mouse capture using the configured policy and screen mode.

Source

pub fn with_budget(self, budget: FrameBudgetConfig) -> Self

Set the budget configuration.

Bound per-frame hyperlink admission and retire unused URLs. See Self::hyperlink_limit for the ID lifetime contract.

Source

pub fn with_load_governor(self, config: LoadGovernorConfig) -> Self

Set the runtime load-governor configuration.

Source

pub fn without_load_governor(self) -> Self

Disable the adaptive load governor and use legacy render-budget behavior.

Source

pub fn with_diff_config(self, diff_config: RuntimeDiffConfig) -> Self

Set the diff strategy configuration for the terminal writer.

Source

pub fn with_evidence_sink(self, config: EvidenceSinkConfig) -> Self

Set the evidence JSONL sink configuration.

Source

pub fn with_render_trace(self, config: RenderTraceConfig) -> Self

Set the render-trace recorder configuration.

Source

pub fn with_frame_timing(self, config: FrameTimingConfig) -> Self

Set a frame timing sink for per-frame profiling.

Source

pub fn with_conformal_config(self, config: ConformalConfig) -> Self

Enable conformal frame-time risk gating with the given config.

Source

pub fn without_conformal(self) -> Self

Disable conformal frame-time risk gating.

Source

pub fn with_locale_context(self, locale_context: LocaleContext) -> Self

Set the locale context used for rendering.

Source

pub fn with_locale(self, locale: impl Into<Locale>) -> Self

Set the base locale used for rendering.

Source

pub fn with_widget_refresh(self, config: WidgetRefreshConfig) -> Self

Set the widget refresh selection configuration.

Source

pub fn with_effect_queue(self, config: EffectQueueConfig) -> Self

Set the effect queue scheduling configuration.

Source

pub fn with_resize_coalescer(self, config: CoalescerConfig) -> Self

Set the resize coalescer configuration.

Source

pub fn with_resize_behavior(self, behavior: ResizeBehavior) -> Self

Set the resize handling behavior.

Source

pub fn with_forced_size(self, width: u16, height: u16) -> Self

Force a fixed terminal size (cols, rows). Resize events are ignored.

Source

pub fn without_forced_size(self) -> Self

Clear any forced terminal size override.

Source

pub fn with_legacy_resize(self, enabled: bool) -> Self

Toggle legacy immediate-resize behavior for migration.

Source

pub fn with_persistence(self, persistence: PersistenceConfig) -> Self

Set the persistence configuration.

Source

pub fn with_registry(self, registry: Arc<StateRegistry>) -> Self

Enable persistence with the given registry.

Source

pub fn with_inline_auto_remeasure( self, config: InlineAutoRemeasureConfig, ) -> Self

Enable inline auto UI height remeasurement with the given policy.

Source

pub fn without_inline_auto_remeasure(self) -> Self

Disable inline auto UI height remeasurement.

Source

pub fn with_signal_interception(self, enabled: bool) -> Self

Enable or disable signal interception (SIGHUP/SIGTERM/SIGINT) for cleanup.

Source

pub fn with_job_control(self, enabled: bool) -> Self

Enable or disable job-control handling (SIGTSTP/SIGTTIN/SIGTTOU). See ProgramConfig::job_control.

Source

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.

Source

pub fn with_guardrails(self, config: GuardrailsConfig) -> Self

Set frame guardrails configuration.

Source

pub fn with_immediate_drain(self, config: ImmediateDrainConfig) -> Self

Set the immediate event-drain policy for burst handling.

Source

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 })
Source

pub fn with_lane(self, lane: RuntimeLane) -> Self

Set the runtime execution lane.

Source

pub fn with_rollout_policy(self, policy: RolloutPolicy) -> Self

Set the rollout policy for the Asupersync migration.

Source

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).

Trait Implementations§

Source§

impl Clone for ProgramConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProgramConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ProgramConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more