Skip to main content

TerminalState

Struct TerminalState 

Source
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

Source

pub fn new(width: usize, height: usize) -> Self

Source

pub fn get_active_buffer(&mut self) -> &mut TerminalScreenBuffer

Source

pub fn get_active_buffer_ref(&self) -> &TerminalScreenBuffer

Source

pub fn get_active_screen(&mut self) -> &mut Vec<Vec<TerminalCell>>

Source

pub fn get_active_screen_ref(&self) -> &Vec<Vec<TerminalCell>>

Source

pub fn get_cursor(&self) -> &CursorState

Source

pub fn get_cursor_mut(&mut self) -> &mut CursorState

Source

pub fn save_cursor(&mut self)

F0305: Cursor Management System - Save cursor position and attributes

Source

pub fn restore_cursor(&mut self)

F0305: Cursor Management System - Restore cursor position and attributes

Source

pub fn set_cursor_position(&mut self, x: usize, y: usize)

F0305: Set cursor position with bounds checking

Source

pub fn move_cursor_relative(&mut self, dx: i32, dy: i32)

F0305: Move cursor relatively with bounds checking

Source

pub fn set_cursor_visibility(&mut self, visible: bool)

F0305: Set cursor visibility

Source

pub fn set_cursor_style(&mut self, style: CursorStyle)

F0305: Set cursor style

Source

pub fn set_cursor_column(&mut self, col: usize)

F0305: Move cursor to column (absolute positioning)

Source

pub fn set_cursor_line(&mut self, line: usize)

F0305: Move cursor to line (absolute positioning)

Source

pub fn cursor_up(&mut self, lines: usize)

F0305: Move cursor up with bounds checking

Source

pub fn cursor_down(&mut self, lines: usize)

F0305: Move cursor down with bounds checking

Source

pub fn cursor_left(&mut self, cols: usize)

F0305: Move cursor left with bounds checking

Source

pub fn cursor_right(&mut self, cols: usize)

F0305: Move cursor right with bounds checking

Source

pub fn cursor_to_line_start(&mut self)

F0305: Move cursor to beginning of line

Source

pub fn cursor_next_line(&mut self, lines: usize)

F0305: Move cursor to next line (carriage return + line feed)

Source

pub fn cursor_previous_line(&mut self, lines: usize)

F0305: Move cursor to previous line

Source

pub fn tab_forward(&mut self)

F0313: Tab forward to next tab stop

Source

pub fn tab_backward(&mut self)

F0313: Tab backward to previous tab stop

Source

pub fn set_line_attribute(&mut self, attribute: LineAttribute)

F0314: Set line attribute for current line

Source

pub fn get_line_attribute(&self, line: usize) -> LineAttribute

F0314: Get line attribute for specific line

Source

pub fn set_double_width_line(&mut self)

F0314: Set double-width line (DECDWL)

Source

pub fn set_double_height_line_top(&mut self)

F0314: Set double-height line top half (DECDHL top)

Source

pub fn set_double_height_line_bottom(&mut self)

F0314: Set double-height line bottom half (DECDHL bottom)

Source

pub fn set_normal_line(&mut self)

F0314: Reset line to normal (single-width, single-height)

Source

pub fn set_scrolling_region( &mut self, top: Option<usize>, bottom: Option<usize>, )

F0307: Set scrolling region (DECSTBM - Set Top and Bottom Margins)

Source

pub fn reset_scrolling_region(&mut self)

F0307: Reset scrolling region to full screen

Source

pub fn scroll_up_in_region(&mut self, lines: usize)

F0307: Scroll up within the scrolling region

Source

pub fn scroll_down_in_region(&mut self, lines: usize)

F0307: Scroll down within the scrolling region

Source

pub fn is_cursor_in_scrolling_region(&self) -> bool

F0307: Check if cursor is within scrolling region

Source

pub fn line_feed_with_scrolling(&mut self)

F0307: Handle line feed with scrolling region awareness

Source

pub fn reverse_line_feed_with_scrolling(&mut self)

F0307: Handle reverse line feed with scrolling region awareness

Source

pub fn insert_character_at_cursor(&mut self)

F0308: Insert character at cursor position (IRM - Insert/Replace Mode)

Source

pub fn delete_character_at_cursor(&mut self, count: usize)

F0308: Delete character at cursor position (DCH command support)

Source

pub fn get_cursor_key_sequence(&self, key: &str) -> String

F0308: Get appropriate escape sequence for cursor key based on cursor key mode

Source

pub fn get_keypad_sequence(&self, key: &str) -> String

F0308: Get appropriate escape sequence for keypad key based on keypad mode

Source

pub fn process_newline(&mut self)

F0308: Handle linefeed/newline mode (LNM) - affects how newlines are processed

Source

pub fn switch_to_alternate_screen(&mut self)

F0312: Switch to alternate screen buffer with proper isolation

Source

pub fn switch_to_primary_screen(&mut self)

F0312: Switch to primary screen buffer maintaining buffer isolation

Source

pub fn clear_alternate_screen(&mut self)

F0312: Clear alternate screen buffer explicitly

Source

pub fn verify_buffer_isolation(&self) -> bool

F0312: Verify buffer isolation - ensure buffers don’t share content

Source

pub fn scroll_up(&mut self, lines: usize)

Source

pub fn scroll_down(&mut self, lines: usize)

Source

pub fn resize(&mut self, new_width: usize, new_height: usize)

Source

pub fn clear_screen(&mut self)

Source

pub fn clear_line(&mut self, line: usize)

Source

pub fn process_dcs_query(&mut self, data: &str)

Process DCS query sequences

Source

pub fn process_dcs_extended(&mut self, data: &str)

Process DCS extended capability sequences

Source

pub fn is_mouse_reporting_enabled(&self) -> bool

F0310: Check if any mouse reporting mode is active

Source

pub fn get_mouse_reporting_mode(&self) -> Option<&str>

F0310: Get the current active mouse reporting mode

Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TerminalState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more