pub struct Terminal { /* private fields */ }Expand description
A pure-Rust VT terminal emulator with incremental byte processing.
Feed bytes via write, then query the screen state via
accessors like plain_text or cell.
Implementations§
Source§impl Terminal
impl Terminal
Sourcepub fn set_max_scrollback(&mut self, max: usize)
pub fn set_max_scrollback(&mut self, max: usize)
Set the maximum number of scrollback lines.
Sourcepub fn take_output(&mut self) -> Vec<u8> ⓘ
pub fn take_output(&mut self) -> Vec<u8> ⓘ
Take accumulated response bytes (DSR replies, DA responses).
Sourcepub fn take_clipboard(&mut self) -> Vec<String>
pub fn take_clipboard(&mut self) -> Vec<String>
Take accumulated clipboard writes.
pub fn cols(&self) -> usize
pub fn rows(&self) -> usize
pub fn active_screen(&self) -> ScreenKind
pub fn cursor(&self) -> Cursor
pub fn current_style(&self) -> &Style
pub fn bell_count(&self) -> usize
pub fn title(&self) -> Option<&str>
Sourcepub fn cell(&self, col: usize, row: usize) -> Option<&Cell>
pub fn cell(&self, col: usize, row: usize) -> Option<&Cell>
Get the cell at the given position.
Sourcepub fn scrollback_len(&self) -> usize
pub fn scrollback_len(&self) -> usize
Number of scrollback lines available.
Sourcepub fn scrollback_row(&self, index: usize) -> Option<String>
pub fn scrollback_row(&self, index: usize) -> Option<String>
Get a scrollback row by index (0 = oldest), trimmed of trailing blanks.
Sourcepub fn plain_text(&self) -> String
pub fn plain_text(&self) -> String
Extract plain text from the visible screen.
Sourcepub fn screen_dump(&self) -> String
pub fn screen_dump(&self) -> String
Extract plain text including scrollback.
pub fn wraparound(&self) -> bool
pub fn cursor_visible(&self) -> bool
pub fn cursor_shape(&self) -> CursorShape
pub fn application_cursor_keys(&self) -> bool
pub fn bracketed_paste(&self) -> bool
pub fn focus_reporting(&self) -> bool
pub fn mouse_tracking(&self) -> Option<MouseTracking>
pub fn sgr_mouse(&self) -> bool
pub fn scroll_region(&self) -> (usize, usize)
Auto Trait Implementations§
impl Freeze for Terminal
impl RefUnwindSafe for Terminal
impl Send for Terminal
impl Sync for Terminal
impl Unpin for Terminal
impl UnsafeUnpin for Terminal
impl UnwindSafe for Terminal
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
Mutably borrows from an owned value. Read more