pub struct ProgramOptions {
pub bracketed_paste: bool,
pub mouse: Option<MouseTracking>,
pub prefer_grapheme_clusters: bool,
pub prefer_in_band_resize: bool,
pub prefer_synchronized_output: bool,
pub query_backspace_mode: bool,
pub query_foreground_color: bool,
pub query_background_color: bool,
pub query_cursor_color: bool,
pub query_palette_colors: Vec<u8>,
pub query_program_status: bool,
pub legacy_keys: DecoderFlags,
}Expand description
Options for session setup, capability queries, and mode preferences.
Program::init_with applies bracketed_paste, mouse, and legacy_keys.
It stores the other options for later use.
The query_* fields select optional requests for
Program::query_capabilities. Call that method to send the queries.
The prefer_* fields control mode adoption when Program::observe_event
receives a report that confirms support for the corresponding mode.
Fields§
§bracketed_paste: boolEnable bracketed paste at init. Defaults to true.
mouse: Option<MouseTracking>Enable mouse tracking at init with the given MouseTracking extras
(see Program::enable_mouse). The request is emitted unconditionally;
terminals ignore modes they do not support and degrade gracefully.
Defaults to None (mouse tracking off).
prefer_grapheme_clusters: boolEnable grapheme-cluster mode (DEC mode 2027) once the terminal reports
it as available, so the terminal and the Screen measure text the
same way. Defaults to true.
Nothing is emitted until that report arrives, which requires
query_capabilities and a read loop.
Set to false to keep per-code-point measurement, or call
enable_grapheme_clusters
yourself to opt in without waiting for a report.
prefer_in_band_resize: boolEnable in-band resize notifications (DEC mode 2048) once the terminal
reports them as available, so resizes arrive on the event stream with
pixel dimensions instead of through SIGWINCH. Defaults to true.
Nothing is emitted until that report arrives, which requires
query_capabilities and a read loop.
Set to false to stay on the signal path, or call
enable_in_band_resize yourself to
opt in without waiting for a report.
prefer_synchronized_output: boolWrap each frame in synchronized-output markers (DEC mode 2026) once the
terminal reports them as available, so a frame is presented in one
piece instead of tearing. Defaults to true.
Unlike the two above this emits nothing of its own: synchronized output
is a render property, so adopting it only tells the Screen to start
bracketing frames. Set to false to keep frames unwrapped for the whole
session. Screen::set_synchronized_output drives the same property
directly, but the program cannot see a choice made there, so a call made
before the terminal’s first report is still overridden by adoption; use
this field when the decision has to hold from the start.
query_backspace_mode: boolInclude Backarrow mode (DECBKM) in Program::query_capabilities.
Defaults to false. Initialization sends no queries.
Program::observe_event applies recognized replies independently of
this option, including replies to Program::request_mode.
query_foreground_color: boolInclude the default foreground color in Program::query_capabilities.
Defaults to false.
query_background_color: boolInclude the default background color in Program::query_capabilities.
Defaults to false.
query_cursor_color: boolInclude the cursor color in Program::query_capabilities.
Defaults to false.
query_palette_colors: Vec<u8>Include these palette indices in Program::query_capabilities.
Defaults to an empty list. Queries follow the supplied order.
query_program_status: boolInclude OSC 7501 support in Program::query_capabilities.
Defaults to false. Initialization sends no queries.
Program::observe_event records support replies regardless of this
option. Reports and record lifetime are independent of query selection.
legacy_keys: DecoderFlagsHow to read the ambiguous legacy keys.
Defaults to empty. LF reads as Ctrl+J;
DecoderFlags::LF_IS_ENTER selects Enter instead. See DecoderFlags
for all mappings. Use Program::set_decoder_flags to change the
active flags after initialization.
Trait Implementations§
Source§impl Clone for ProgramOptions
impl Clone for ProgramOptions
Source§fn clone(&self) -> ProgramOptions
fn clone(&self) -> ProgramOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more