pub struct Screen { /* private fields */ }termtui only.Expand description
Represents the overall terminal state.
Implementations§
Source§impl Screen
impl Screen
pub fn get_selected_text( &self, low_x: i32, low_y: i32, high_x: i32, high_y: i32, ) -> String
Sourcepub fn size(&self) -> Size
pub fn size(&self) -> Size
Returns the current size of the terminal.
The return value will be (rows, cols).
Sourcepub fn scrollback(&self) -> usize
pub fn scrollback(&self) -> usize
Returns the current position in the scrollback.
This position indicates the offset from the top of the screen, and is
0 when the normal screen is in view.
pub fn scrollback_len(&self) -> usize
pub fn set_scrollback(&mut self, rows: usize)
pub fn scroll_screen_up(&mut self, n: usize)
pub fn scroll_screen_down(&mut self, n: usize)
Sourcepub fn cursor_position(&self) -> (u16, u16)
pub fn cursor_position(&self) -> (u16, u16)
Returns the current cursor position of the terminal.
The return value will be (row, col).
Sourcepub fn cell(&self, row: u16, col: u16) -> Option<&Cell>
pub fn cell(&self, row: u16, col: u16) -> Option<&Cell>
Returns the Cell object at the given location in the terminal, if it
exists.
pub fn cursor_style(&self) -> CursorStyle
Sourcepub fn application_cursor(&self) -> bool
pub fn application_cursor(&self) -> bool
Returns whether the terminal should be in application cursor mode.
Sourcepub fn hide_cursor(&self) -> bool
pub fn hide_cursor(&self) -> bool
Returns whether the terminal should be in hide cursor mode.
Sourcepub fn mouse_protocol_mode(&self) -> MouseProtocolMode
pub fn mouse_protocol_mode(&self) -> MouseProtocolMode
Returns the currently active MouseProtocolMode
Source§impl Screen
impl Screen
Sourcepub fn process(&mut self, data: &[u8], events: &mut Vec<VtEvent>)
pub fn process(&mut self, data: &[u8], events: &mut Vec<VtEvent>)
https://man7.org/linux/man-pages/man4/console_codes.4.html https://en.wikipedia.org/wiki/ANSI_escape_code https://terminalguide.namepad.de/seq/ https://vt100.net/docs/vt510-rm/contents.html https://xtermjs.org/docs/api/vtfeatures/ https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences https://bjh21.me.uk/all-escapes/all-escapes.txt
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Screen
impl RefUnwindSafe for Screen
impl Send for Screen
impl Sync for Screen
impl Unpin for Screen
impl UnsafeUnpin for Screen
impl UnwindSafe for Screen
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more