pub struct RunConfig {
pub tick_rate: Duration,
pub mouse: bool,
pub kitty_keyboard: bool,
pub theme: Theme,
pub color_depth: Option<ColorDepth>,
pub max_fps: Option<u32>,
}Expand description
Configuration for a TUI run loop.
Pass to run_with or run_inline_with to customize behavior.
Use Default::default() for sensible defaults (16ms tick / 60fps, no mouse, dark theme).
§Example
use slt::{RunConfig, Theme};
use std::time::Duration;
let config = RunConfig {
tick_rate: Duration::from_millis(50),
mouse: true,
kitty_keyboard: false,
theme: Theme::light(),
color_depth: None,
max_fps: Some(60),
};Fields§
§tick_rate: DurationHow long to wait for input before triggering a tick with no events.
Lower values give smoother animations at the cost of more CPU usage. Defaults to 16ms (60fps).
mouse: boolWhether to enable mouse event reporting.
When true, the terminal captures mouse clicks, scrolls, and movement.
Defaults to false.
kitty_keyboard: boolWhether to enable the Kitty keyboard protocol for enhanced input.
When true, enables disambiguated key events, key release events,
and modifier-only key reporting on supporting terminals (kitty, Ghostty, WezTerm).
Terminals that don’t support it silently ignore the request.
Defaults to false.
theme: ThemeThe color theme applied to all widgets automatically.
Defaults to Theme::dark().
color_depth: Option<ColorDepth>Color depth override.
None means auto-detect from $COLORTERM and $TERM environment
variables. Set explicitly to force a specific color depth regardless
of terminal capabilities.
max_fps: Option<u32>Optional maximum frame rate.
None means unlimited frame rate. Some(fps) sleeps at the end of each
loop iteration to target that frame time.