pub struct State { /* private fields */ }Expand description
Session choices tracked by Program for save and restore.
The values record requests staged through Program, including preferences
adopted after discovery. They describe the state restored after a shell
handoff, even while the program is paused. They do not confirm terminal
acceptance or successful output after an I/O error. Direct writes and
changes through screen_mut are outside this record.
Capabilities holds terminal replies separately. Startup configuration
stays in ProgramOptions. Read the current choices
through Program::state, or clone them for an owned
snapshot. Neither operation sends queries or waits for replies.
Implementations§
Source§impl State
impl State
Sourcepub fn cursor_style(&self) -> CursorStyle
pub fn cursor_style(&self) -> CursorStyle
Cursor appearance selected through Program, or the terminal default.
Sourcepub fn cursor_color(&self) -> Option<Color>
pub fn cursor_color(&self) -> Option<Color>
Requested cursor color override, or the terminal default.
Sourcepub fn cursor_visible(&self) -> bool
pub fn cursor_visible(&self) -> bool
Requested hardware cursor visibility. Initially true.
Sourcepub fn alt_screen(&self) -> bool
pub fn alt_screen(&self) -> bool
Whether the alternate screen buffer is selected.
Sourcepub fn mouse(&self) -> Option<Option<MouseTracking>>
pub fn mouse(&self) -> Option<Option<MouseTracking>>
Selected mouse policy. None means no choice; Some(None) disables
tracking. Some(Some(empty())) requests basic button tracking.
Sourcepub fn kitty_keyboard(&self) -> Option<KittyKeyboardFlags>
pub fn kitty_keyboard(&self) -> Option<KittyKeyboardFlags>
Selected Kitty flags. None means no choice; Some(empty()) explicitly
disables all enhancements. The selection follows buffer transitions.
Sourcepub fn modify_other_keys(&self) -> Option<ModifyOtherKeysMode>
pub fn modify_other_keys(&self) -> Option<ModifyOtherKeysMode>
Selected modifyOtherKeys mode, including an explicit disabled choice.
None means the application has made no choice.
Sourcepub fn mode(&self, mode: Mode) -> Option<bool>
pub fn mode(&self, mode: Mode) -> Option<bool>
Selected value of a tracked boolean mode.
None means no choice was made through Program, or the mode is
outside this record. Some(false) is an explicit reset. Supported modes
are alternate screen (1049), cursor visibility (25), bracketed paste
(2004), focus (1004), color scheme (2031), visibility reports (2033),
in-band resize (2048), Unicode core (2027), and Backarrow (67).
This records application choices and adopted preferences, independently
of the last report in Capabilities::mode.
Sourcepub fn foreground_color(&self) -> Option<Color>
pub fn foreground_color(&self) -> Option<Color>
Requested default foreground override.
Sourcepub fn background_color(&self) -> Option<Color>
pub fn background_color(&self) -> Option<Color>
Requested default background override.
Sourcepub fn window_title(&self) -> Option<&str>
pub fn window_title(&self) -> Option<&str>
Requested window title override.
Sourcepub fn pointer_shape(&self) -> Option<&str>
pub fn pointer_shape(&self) -> Option<&str>
Requested pointer shape override.
Sourcepub fn progress(&self) -> Option<ProgressState>
pub fn progress(&self) -> Option<ProgressState>
Requested progress indicator.