pub struct ScreenOptions {
pub bracketed_paste: bool,
pub keyboard_enhancements: KittyKeyboardFlags,
pub prefer_in_band_resize: bool,
pub request_pixel_size_on_resize: bool,
pub mouse: Option<MouseTracking>,
pub query_capabilities: bool,
pub query_drain_timeout: Duration,
}Expand description
Desired default behaviors applied by Screen::init_with.
Always-on defaults (e.g. bracketed_paste)
take effect at init regardless of capability detection. Discovery-driven
defaults are applied once the terminating Primary DA reply confirms the
detected Capabilities; if the terminal never answers, only the
always-on defaults are in effect.
Most fields are app-level toggles you set to taste. Two are low-level
transport knobs that most applications should leave at their defaults:
request_pixel_size_on_resize
(when to re-query the window pixel size) and
query_drain_timeout (how long teardown
waits for capability replies). They exist for unusual terminals and
latency-sensitive teardown, not everyday configuration.
Fields§
§bracketed_paste: boolEnable bracketed paste at init. Defaults to true.
keyboard_enhancements: KittyKeyboardFlagsDesired Kitty keyboard enhancements. When non-empty, the screen
enables as many as the terminal supports, preferring the Kitty
protocol and falling back to xterm modifyOtherKeys when Kitty is
unavailable. Defaults to
KittyKeyboardFlags::DISAMBIGUATE_ESCAPE_CODES.
prefer_in_band_resize: boolPrefer in-band resize reports over the SIGWINCH path when the
terminal supports them. Defaults to true.
request_pixel_size_on_resize: boolRequest the window pixel size (XTWINOPS CSI 14 t) whenever a resize
is observed that does not itself carry pixel dimensions, keeping
window_pixels current on platforms that
report cell sizes only. Skipped while in-band resize is active, since
those reports already carry pixel dimensions. Defaults to true on
Windows (whose console resize events carry no pixel size) and false
elsewhere, where resize reports already include pixel dimensions.
mouse: Option<MouseTracking>Enable mouse tracking at init with the given MouseTracking extras
(see Screen::enable_mouse). The request is emitted unconditionally;
terminals ignore modes they do not support and degrade gracefully.
Defaults to None (mouse tracking off).
query_capabilities: boolSend terminal capability queries during
init.
When true (the default), init_with probes the
terminal for its keyboard, color, and feature support and waits for the
replies, populating capabilities. Set it to
false for output-only programs that draw frames and never read input:
init_with still enters raw mode, sizes the managed area, and applies the
environment-detected color profile, but emits no query escapes and
waits for no replies, so the terminal is never probed and
capabilities stays at its env-derived
defaults.
query_drain_timeout: DurationHow long teardown (finish /
pause) will wait for the capability-query replies
to arrive before restoring the terminal, so they cannot leak to the
shell (or a child after pause) as stray input.
The wait is measured from when init sent the
queries and ends early as soon as the terminating Primary DA reply
lands, so a responsive terminal costs only its round-trip and a
long-running app pays nothing (the replies are consumed by the event
loop, and the budget has long since elapsed). Only the rare path that
tears down before the replies were consumed waits here. Defaults to
300ms.
Trait Implementations§
Source§impl Clone for ScreenOptions
impl Clone for ScreenOptions
Source§fn clone(&self) -> ScreenOptions
fn clone(&self) -> ScreenOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more