pub struct TerminalState {Show 22 fields
pub screen_width: usize,
pub screen_height: usize,
pub primary_buffer: TerminalScreenBuffer,
pub alternate_buffer: TerminalScreenBuffer,
pub use_alternate_screen: bool,
pub cursor_save_stack: Vec<CursorState>,
pub current_attributes: TerminalCell,
pub mode: TerminalMode,
pub scroll_region: ScrollRegion,
pub tab_stops: Vec<bool>,
pub charset_g0: Option<String>,
pub charset_g1: Option<String>,
pub active_charset: u8,
pub terminal_title: Option<String>,
pub icon_name: Option<String>,
pub title_changed: bool,
pub full_screen_program_detected: bool,
pub sgr_state: SGRState,
pub dcs_sequence_type: Option<char>,
pub dcs_buffer: Option<Vec<u8>>,
pub pending_response: Option<String>,
pub osc_buffer: Option<Vec<u8>>,
}Fields§
§screen_width: usize§screen_height: usize§primary_buffer: TerminalScreenBuffer§alternate_buffer: TerminalScreenBuffer§use_alternate_screen: bool§cursor_save_stack: Vec<CursorState>§current_attributes: TerminalCell§mode: TerminalMode§scroll_region: ScrollRegion§tab_stops: Vec<bool>§charset_g0: Option<String>§charset_g1: Option<String>§active_charset: u8§terminal_title: Option<String>§icon_name: Option<String>§title_changed: bool§full_screen_program_detected: bool§sgr_state: SGRState§dcs_sequence_type: Option<char>§dcs_buffer: Option<Vec<u8>>§pending_response: Option<String>§osc_buffer: Option<Vec<u8>>Implementations§
Source§impl TerminalState
impl TerminalState
pub fn new(width: usize, height: usize) -> Self
pub fn get_active_buffer(&mut self) -> &mut TerminalScreenBuffer
pub fn get_active_buffer_ref(&self) -> &TerminalScreenBuffer
pub fn get_active_screen(&mut self) -> &mut Vec<Vec<TerminalCell>>
pub fn get_active_screen_ref(&self) -> &Vec<Vec<TerminalCell>>
pub fn get_cursor(&self) -> &CursorState
pub fn get_cursor_mut(&mut self) -> &mut CursorState
Sourcepub fn save_cursor(&mut self)
pub fn save_cursor(&mut self)
F0305: Cursor Management System - Save cursor position and attributes
Sourcepub fn restore_cursor(&mut self)
pub fn restore_cursor(&mut self)
F0305: Cursor Management System - Restore cursor position and attributes
Sourcepub fn set_cursor_position(&mut self, x: usize, y: usize)
pub fn set_cursor_position(&mut self, x: usize, y: usize)
F0305: Set cursor position with bounds checking
Sourcepub fn move_cursor_relative(&mut self, dx: i32, dy: i32)
pub fn move_cursor_relative(&mut self, dx: i32, dy: i32)
F0305: Move cursor relatively with bounds checking
Sourcepub fn set_cursor_visibility(&mut self, visible: bool)
pub fn set_cursor_visibility(&mut self, visible: bool)
F0305: Set cursor visibility
Sourcepub fn set_cursor_style(&mut self, style: CursorStyle)
pub fn set_cursor_style(&mut self, style: CursorStyle)
F0305: Set cursor style
Sourcepub fn set_cursor_column(&mut self, col: usize)
pub fn set_cursor_column(&mut self, col: usize)
F0305: Move cursor to column (absolute positioning)
Sourcepub fn set_cursor_line(&mut self, line: usize)
pub fn set_cursor_line(&mut self, line: usize)
F0305: Move cursor to line (absolute positioning)
Sourcepub fn cursor_down(&mut self, lines: usize)
pub fn cursor_down(&mut self, lines: usize)
F0305: Move cursor down with bounds checking
Sourcepub fn cursor_left(&mut self, cols: usize)
pub fn cursor_left(&mut self, cols: usize)
F0305: Move cursor left with bounds checking
Sourcepub fn cursor_right(&mut self, cols: usize)
pub fn cursor_right(&mut self, cols: usize)
F0305: Move cursor right with bounds checking
Sourcepub fn cursor_to_line_start(&mut self)
pub fn cursor_to_line_start(&mut self)
F0305: Move cursor to beginning of line
Sourcepub fn cursor_next_line(&mut self, lines: usize)
pub fn cursor_next_line(&mut self, lines: usize)
F0305: Move cursor to next line (carriage return + line feed)
Sourcepub fn cursor_previous_line(&mut self, lines: usize)
pub fn cursor_previous_line(&mut self, lines: usize)
F0305: Move cursor to previous line
Sourcepub fn tab_forward(&mut self)
pub fn tab_forward(&mut self)
F0313: Tab forward to next tab stop
Sourcepub fn tab_backward(&mut self)
pub fn tab_backward(&mut self)
F0313: Tab backward to previous tab stop
Sourcepub fn set_line_attribute(&mut self, attribute: LineAttribute)
pub fn set_line_attribute(&mut self, attribute: LineAttribute)
F0314: Set line attribute for current line
Sourcepub fn get_line_attribute(&self, line: usize) -> LineAttribute
pub fn get_line_attribute(&self, line: usize) -> LineAttribute
F0314: Get line attribute for specific line
Sourcepub fn set_double_width_line(&mut self)
pub fn set_double_width_line(&mut self)
F0314: Set double-width line (DECDWL)
Sourcepub fn set_double_height_line_top(&mut self)
pub fn set_double_height_line_top(&mut self)
F0314: Set double-height line top half (DECDHL top)
Sourcepub fn set_double_height_line_bottom(&mut self)
pub fn set_double_height_line_bottom(&mut self)
F0314: Set double-height line bottom half (DECDHL bottom)
Sourcepub fn set_normal_line(&mut self)
pub fn set_normal_line(&mut self)
F0314: Reset line to normal (single-width, single-height)
Sourcepub fn set_scrolling_region(
&mut self,
top: Option<usize>,
bottom: Option<usize>,
)
pub fn set_scrolling_region( &mut self, top: Option<usize>, bottom: Option<usize>, )
F0307: Set scrolling region (DECSTBM - Set Top and Bottom Margins)
Sourcepub fn reset_scrolling_region(&mut self)
pub fn reset_scrolling_region(&mut self)
F0307: Reset scrolling region to full screen
Sourcepub fn scroll_up_in_region(&mut self, lines: usize)
pub fn scroll_up_in_region(&mut self, lines: usize)
F0307: Scroll up within the scrolling region
Sourcepub fn scroll_down_in_region(&mut self, lines: usize)
pub fn scroll_down_in_region(&mut self, lines: usize)
F0307: Scroll down within the scrolling region
Sourcepub fn is_cursor_in_scrolling_region(&self) -> bool
pub fn is_cursor_in_scrolling_region(&self) -> bool
F0307: Check if cursor is within scrolling region
Sourcepub fn line_feed_with_scrolling(&mut self)
pub fn line_feed_with_scrolling(&mut self)
F0307: Handle line feed with scrolling region awareness
Sourcepub fn reverse_line_feed_with_scrolling(&mut self)
pub fn reverse_line_feed_with_scrolling(&mut self)
F0307: Handle reverse line feed with scrolling region awareness
Sourcepub fn insert_character_at_cursor(&mut self)
pub fn insert_character_at_cursor(&mut self)
F0308: Insert character at cursor position (IRM - Insert/Replace Mode)
Sourcepub fn delete_character_at_cursor(&mut self, count: usize)
pub fn delete_character_at_cursor(&mut self, count: usize)
F0308: Delete character at cursor position (DCH command support)
Sourcepub fn get_cursor_key_sequence(&self, key: &str) -> String
pub fn get_cursor_key_sequence(&self, key: &str) -> String
F0308: Get appropriate escape sequence for cursor key based on cursor key mode
Sourcepub fn get_keypad_sequence(&self, key: &str) -> String
pub fn get_keypad_sequence(&self, key: &str) -> String
F0308: Get appropriate escape sequence for keypad key based on keypad mode
Sourcepub fn process_newline(&mut self)
pub fn process_newline(&mut self)
F0308: Handle linefeed/newline mode (LNM) - affects how newlines are processed
Sourcepub fn switch_to_alternate_screen(&mut self)
pub fn switch_to_alternate_screen(&mut self)
F0312: Switch to alternate screen buffer with proper isolation
Sourcepub fn switch_to_primary_screen(&mut self)
pub fn switch_to_primary_screen(&mut self)
F0312: Switch to primary screen buffer maintaining buffer isolation
Sourcepub fn clear_alternate_screen(&mut self)
pub fn clear_alternate_screen(&mut self)
F0312: Clear alternate screen buffer explicitly
Sourcepub fn verify_buffer_isolation(&self) -> bool
pub fn verify_buffer_isolation(&self) -> bool
F0312: Verify buffer isolation - ensure buffers don’t share content
pub fn scroll_up(&mut self, lines: usize)
pub fn scroll_down(&mut self, lines: usize)
pub fn resize(&mut self, new_width: usize, new_height: usize)
pub fn clear_screen(&mut self)
pub fn clear_line(&mut self, line: usize)
Sourcepub fn process_dcs_query(&mut self, data: &str)
pub fn process_dcs_query(&mut self, data: &str)
Process DCS query sequences
Sourcepub fn process_dcs_extended(&mut self, data: &str)
pub fn process_dcs_extended(&mut self, data: &str)
Process DCS extended capability sequences
Sourcepub fn is_mouse_reporting_enabled(&self) -> bool
pub fn is_mouse_reporting_enabled(&self) -> bool
F0310: Check if any mouse reporting mode is active
Sourcepub fn get_mouse_reporting_mode(&self) -> Option<&str>
pub fn get_mouse_reporting_mode(&self) -> Option<&str>
F0310: Get the current active mouse reporting mode
Sourcepub fn generate_mouse_report(
&self,
event_type: MouseEventType,
x: usize,
y: usize,
button: Option<MouseButton>,
modifiers: MouseModifiers,
) -> Option<String>
pub fn generate_mouse_report( &self, event_type: MouseEventType, x: usize, y: usize, button: Option<MouseButton>, modifiers: MouseModifiers, ) -> Option<String>
F0310: Generate mouse report sequence for xterm compatibility
Trait Implementations§
Source§impl Clone for TerminalState
impl Clone for TerminalState
Auto Trait Implementations§
impl Forget for TerminalState
impl Freeze for TerminalState
impl Move for TerminalState
impl RefUnwindSafe for TerminalState
impl Send for TerminalState
impl Sync for TerminalState
impl Unpin for TerminalState
impl UnsafeUnpin for TerminalState
impl UnwindSafe for TerminalState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.