pub struct Modes {
pub dec: DecModes,
pub ansi: AnsiModes,
}Expand description
Combined mode state for the terminal.
Fields§
§dec: DecModes§ansi: AnsiModesImplementations§
Source§impl Modes
impl Modes
Sourcepub fn new() -> Self
pub fn new() -> Self
Construct default modes (typical xterm defaults). DECAWM and DECTCEM are ON by default.
Sourcepub fn origin_mode(&self) -> bool
pub fn origin_mode(&self) -> bool
Whether origin mode (DECOM) is enabled.
Sourcepub fn set_origin_mode(&mut self, enabled: bool)
pub fn set_origin_mode(&mut self, enabled: bool)
Enable/disable origin mode.
Sourcepub fn set_autowrap(&mut self, enabled: bool)
pub fn set_autowrap(&mut self, enabled: bool)
Enable/disable autowrap.
Sourcepub fn cursor_visible(&self) -> bool
pub fn cursor_visible(&self) -> bool
Whether the cursor is visible (DECTCEM).
Sourcepub fn set_cursor_visible(&mut self, enabled: bool)
pub fn set_cursor_visible(&mut self, enabled: bool)
Enable/disable cursor visibility.
Sourcepub fn insert_mode(&self) -> bool
pub fn insert_mode(&self) -> bool
Whether insert mode (IRM) is enabled.
Sourcepub fn set_insert_mode(&mut self, enabled: bool)
pub fn set_insert_mode(&mut self, enabled: bool)
Enable/disable insert mode.
Sourcepub fn alt_screen(&self) -> bool
pub fn alt_screen(&self) -> bool
Whether alt screen buffer is active.
Sourcepub fn set_alt_screen(&mut self, enabled: bool)
pub fn set_alt_screen(&mut self, enabled: bool)
Enable/disable alt screen.
Sourcepub fn bracketed_paste(&self) -> bool
pub fn bracketed_paste(&self) -> bool
Whether bracketed paste is enabled.
Sourcepub fn set_bracketed_paste(&mut self, enabled: bool)
pub fn set_bracketed_paste(&mut self, enabled: bool)
Enable/disable bracketed paste.
Sourcepub fn focus_events(&self) -> bool
pub fn focus_events(&self) -> bool
Whether focus event reporting is enabled.
Sourcepub fn set_focus_events(&mut self, enabled: bool)
pub fn set_focus_events(&mut self, enabled: bool)
Enable/disable focus events.
Sourcepub fn sync_output(&self) -> bool
pub fn sync_output(&self) -> bool
Whether synchronized output is enabled.
Sourcepub fn set_sync_output(&mut self, enabled: bool)
pub fn set_sync_output(&mut self, enabled: bool)
Enable/disable synchronized output.
Sourcepub fn set_dec_mode(&mut self, mode: u16, enabled: bool) -> bool
pub fn set_dec_mode(&mut self, mode: u16, enabled: bool) -> bool
Set a DEC private mode by its ECMA-48 number.
Returns true if the mode is recognized.
Sourcepub fn dec_mode(&self, mode: u16) -> Option<bool>
pub fn dec_mode(&self, mode: u16) -> Option<bool>
Query a DEC private mode by number.
Returns:
Some(true)if the mode is recognized and set,Some(false)if the mode is recognized and reset,Noneif the mode number is unknown.
Sourcepub fn set_ansi_mode(&mut self, mode: u16, enabled: bool) -> bool
pub fn set_ansi_mode(&mut self, mode: u16, enabled: bool) -> bool
Set an ANSI standard mode by its number.
Returns true if the mode is recognized.