pub struct Screen { /* private fields */ }Expand description
One pane screen, including scrollback, alternate-screen state, cursor position, modes, tab stops, and hyperlink storage.
Implementations§
Source§impl Screen
impl Screen
Sourcepub fn capture_transcript(
&self,
range: ScreenCaptureRange,
options: GridRenderOptions,
) -> Vec<u8> ⓘ
pub fn capture_transcript( &self, range: ScreenCaptureRange, options: GridRenderOptions, ) -> Vec<u8> ⓘ
Captures a tmux-style line range over the current grid contents.
Sourcepub fn capture_transcript_lines_independent(
&self,
range: ScreenCaptureRange,
options: GridRenderOptions,
) -> Vec<Vec<u8>>
pub fn capture_transcript_lines_independent( &self, range: ScreenCaptureRange, options: GridRenderOptions, ) -> Vec<Vec<u8>>
Captures physical lines with each line rendered from a fresh ANSI state.
This is intended for renderers that repaint individual terminal rows: a row must carry its own SGR state instead of depending on a previous captured row having been emitted first.
Sourcepub fn capture_saved_transcript(
&self,
range: ScreenCaptureRange,
options: GridRenderOptions,
) -> Option<Vec<u8>>
pub fn capture_saved_transcript( &self, range: ScreenCaptureRange, options: GridRenderOptions, ) -> Option<Vec<u8>>
Captures the saved pre-alternate-screen copy when alternate mode is active.
Source§impl Screen
impl Screen
Sourcepub fn tmux_history_bytes(&self) -> usize
pub fn tmux_history_bytes(&self) -> usize
Returns tmux-compatible grid allocation bytes for #{history_bytes}.
Sourcepub fn tmux_history_all_bytes(&self) -> String
pub fn tmux_history_all_bytes(&self) -> String
Returns tmux-compatible grid allocation counters for #{history_all_bytes}.
Source§impl Screen
impl Screen
Sourcepub fn mark_selected_row_range(&mut self, row: u32, start_x: u32, end_x: u32)
pub fn mark_selected_row_range(&mut self, row: u32, start_x: u32, end_x: u32)
Marks one visible row range as selected.
Sourcepub fn overlay_style_on_selected(&mut self, style_input: &str)
pub fn overlay_style_on_selected(&mut self, style_input: &str)
Overlays style_input onto all selected visible cells.
Source§impl Screen
impl Screen
Sourcepub fn overlay_style_on_default_cells(&mut self, style_input: &str)
pub fn overlay_style_on_default_cells(&mut self, style_input: &str)
Applies style_input only where the application left cell styling unset.
Sourcepub fn overlay_default_style(&mut self, style: &Style)
pub fn overlay_default_style(&mut self, style: &Style)
Applies style only where the application left cell styling unset.
Source§impl Screen
impl Screen
Sourcepub fn absolute_line_view(&self, absolute_y: usize) -> Option<ScreenLineView>
pub fn absolute_line_view(&self, absolute_y: usize) -> Option<ScreenLineView>
Returns a read-only copy of one absolute line.
Sourcepub fn clone_viewport(
&self,
top_line: usize,
cursor_x: u32,
cursor_absolute_y: usize,
) -> Self
pub fn clone_viewport( &self, top_line: usize, cursor_x: u32, cursor_absolute_y: usize, ) -> Self
Clones the screen as a standalone viewport over its absolute lines.
Source§impl Screen
impl Screen
Sourcepub fn new(size: TerminalSize, history_limit: usize) -> Self
pub fn new(size: TerminalSize, history_limit: usize) -> Self
Creates a new screen with the given geometry and history limit.
Sourcepub const fn cursor_style(&self) -> u32
pub const fn cursor_style(&self) -> u32
Returns the most recent DECSCUSR cursor style parameter.
Sourcepub fn size(&self) -> TerminalSize
pub fn size(&self) -> TerminalSize
Returns the screen size.
Sourcepub fn is_alternate(&self) -> bool
pub fn is_alternate(&self) -> bool
Returns whether the alternate screen is active.
Sourcepub fn history_limit(&self) -> usize
pub fn history_limit(&self) -> usize
Returns the configured history limit.
Sourcepub fn history_size(&self) -> usize
pub fn history_size(&self) -> usize
Returns the current history size in rows.
Sourcepub const fn cursor_position(&self) -> (u32, u32)
pub const fn cursor_position(&self) -> (u32, u32)
Returns the current cursor position within the visible viewport.
Sourcepub fn cursor_absolute_y(&self) -> usize
pub fn cursor_absolute_y(&self) -> usize
Returns the absolute cursor row including history.
Sourcepub fn absolute_line_count(&self) -> usize
pub fn absolute_line_count(&self) -> usize
Returns the total number of absolute lines retained by the screen.
Sourcepub fn delete_visible_line(&mut self, y: u32) -> bool
pub fn delete_visible_line(&mut self, y: u32) -> bool
Deletes one visible line and scrolls the remaining viewport content up.
This clears any pending wrap state because deleting a visible row invalidates the previous cursor edge condition.
Sourcepub fn delete_absolute_line(&mut self, absolute_y: usize) -> bool
pub fn delete_absolute_line(&mut self, absolute_y: usize) -> bool
Deletes one absolute line from history or the visible viewport.
Sourcepub fn history_bytes(&self) -> usize
pub fn history_bytes(&self) -> usize
Returns the current retained history size in bytes.
Sourcepub fn take_bell_count(&mut self) -> u64
pub fn take_bell_count(&mut self) -> u64
Drains and returns the number of BEL notifications observed since the last drain.
Sourcepub fn take_terminal_passthrough(&mut self) -> Vec<TerminalPassthrough>
pub fn take_terminal_passthrough(&mut self) -> Vec<TerminalPassthrough>
Drains terminal passthrough events observed since the last drain.
Sourcepub fn take_terminal_passthrough_dropped_count(&mut self) -> u64
pub fn take_terminal_passthrough_dropped_count(&mut self) -> u64
Drains the count of terminal passthrough events dropped by safety limits.
Sourcepub fn hyperlink_uri(&self, inner_id: u32) -> Option<&str>
pub fn hyperlink_uri(&self, inner_id: u32) -> Option<&str>
Returns the stored OSC 8 URI for a hyperlink inner ID.
Sourcepub fn set_history_limit(&mut self, limit: usize)
pub fn set_history_limit(&mut self, limit: usize)
Updates the history limit.
Sourcepub fn set_utf8_config(&mut self, utf8_config: Utf8Config)
pub fn set_utf8_config(&mut self, utf8_config: Utf8Config)
Updates the tmux-style UTF-8 width and combining configuration.
Sourcepub fn resize(&mut self, size: TerminalSize)
pub fn resize(&mut self, size: TerminalSize)
Resizes the screen and resets the scroll region.
Sourcepub fn clear_history_and_hyperlinks(&mut self, reset_hyperlinks: bool)
pub fn clear_history_and_hyperlinks(&mut self, reset_hyperlinks: bool)
Clears history and optionally resets stored hyperlinks.
Trait Implementations§
Source§impl ScreenWriter for Screen
impl ScreenWriter for Screen
Source§fn collect_add(&mut self, ch: char, cell: &CellState)
fn collect_add(&mut self, ch: char, cell: &CellState)
Source§fn collect_add_with_charset(&mut self, ch: char, cell: &CellState, acs: bool)
fn collect_add_with_charset(&mut self, ch: char, cell: &CellState, acs: bool)
acs is true.Source§fn cursor_down(&mut self, n: u32)
fn cursor_down(&mut self, n: u32)
n rows.Source§fn cursor_left(&mut self, n: u32)
fn cursor_left(&mut self, n: u32)
n columns.Source§fn cursor_right(&mut self, n: u32)
fn cursor_right(&mut self, n: u32)
n columns.Source§fn cursor_move(&mut self, col: i32, row: i32, origin_mode: bool)
fn cursor_move(&mut self, col: i32, row: i32, origin_mode: bool)
Source§fn insert_line(&mut self, n: u32, bg: i32)
fn insert_line(&mut self, n: u32, bg: i32)
n blank lines at cursor, scrolling down.Source§fn delete_line(&mut self, n: u32, bg: i32)
fn delete_line(&mut self, n: u32, bg: i32)
n lines at cursor, scrolling up.Source§fn scroll_down(&mut self, n: u32, bg: i32)
fn scroll_down(&mut self, n: u32, bg: i32)
n lines.Source§fn reverse_index(&mut self, bg: i32)
fn reverse_index(&mut self, bg: i32)
Source§fn carriage_return(&mut self)
fn carriage_return(&mut self)
Source§fn insert_character(&mut self, n: u32, bg: i32)
fn insert_character(&mut self, n: u32, bg: i32)
n blank characters at cursor.Source§fn delete_character(&mut self, n: u32, bg: i32)
fn delete_character(&mut self, n: u32, bg: i32)
n characters at cursor.Source§fn clear_character(&mut self, n: u32, bg: i32)
fn clear_character(&mut self, n: u32, bg: i32)
n characters at cursor.Source§fn clear_end_of_screen(&mut self, bg: i32)
fn clear_end_of_screen(&mut self, bg: i32)
Source§fn clear_start_of_screen(&mut self, bg: i32)
fn clear_start_of_screen(&mut self, bg: i32)
Source§fn clear_screen(&mut self, bg: i32)
fn clear_screen(&mut self, bg: i32)
Source§fn clear_history(&mut self)
fn clear_history(&mut self)
Source§fn clear_end_of_line(&mut self, bg: i32)
fn clear_end_of_line(&mut self, bg: i32)
Source§fn clear_start_of_line(&mut self, bg: i32)
fn clear_start_of_line(&mut self, bg: i32)
Source§fn clear_line(&mut self, bg: i32)
fn clear_line(&mut self, bg: i32)
Source§fn mode_clear(&mut self, mode_bits: u32)
fn mode_clear(&mut self, mode_bits: u32)
Source§fn set_scroll_region(&mut self, top: u32, bottom: u32)
fn set_scroll_region(&mut self, top: u32, bottom: u32)
Source§fn alternate_on(&mut self, bg: i32, save_cursor: bool)
fn alternate_on(&mut self, bg: i32, save_cursor: bool)
save_cursor = true for 1049.Source§fn alternate_off(&mut self, _bg: i32, restore_cursor: bool)
fn alternate_off(&mut self, _bg: i32, restore_cursor: bool)
Source§fn cursor_backward_tab(&mut self, n: u32)
fn cursor_backward_tab(&mut self, n: u32)
n tab stops (CBT).Source§fn set_tab_stop(&mut self)
fn set_tab_stop(&mut self)
Source§fn clear_tab_stop(&mut self)
fn clear_tab_stop(&mut self)
Source§fn clear_all_tab_stops(&mut self)
fn clear_all_tab_stops(&mut self)
Source§fn set_window_name(&mut self, name: &str)
fn set_window_name(&mut self, name: &str)
Source§fn save_cursor(&mut self)
fn save_cursor(&mut self)
Source§fn restore_cursor(&mut self)
fn restore_cursor(&mut self)
Source§fn alignment_test(&mut self)
fn alignment_test(&mut self)
Source§fn full_reset(&mut self)
fn full_reset(&mut self)
Source§fn start_sync(&mut self)
fn start_sync(&mut self)
Source§fn set_cursor_style(&mut self, n: u32)
fn set_cursor_style(&mut self, n: u32)
n is the Ps value 0-6.