pub struct TerminalScreen { /* private fields */ }Expand description
Live terminal screen fed by rmux-core’s private parser boundary.
TerminalScreen is the public core facade that server code uses to feed
raw PTY bytes and inspect structured screen cells. The parser itself stays
hidden behind the crate-private terminal module, so SDK/protocol code can
depend on screen-cell semantics without coupling to parser internals.
Implementations§
Source§impl TerminalScreen
impl TerminalScreen
Sourcepub fn new(size: TerminalSize, history_limit: usize) -> Self
pub fn new(size: TerminalSize, history_limit: usize) -> Self
Builds a fresh terminal screen with the given geometry and scrollback limit.
Sourcepub fn screen_mut(&mut self) -> &mut Screen
pub fn screen_mut(&mut self) -> &mut Screen
Returns a mutable borrow of the structured screen grid.
Sourcepub fn plain_output_forwarding_safe(&self) -> bool
pub fn plain_output_forwarding_safe(&self) -> bool
Returns whether plain printable output can bypass structured rendering without losing parser or screen semantics.
Sourcepub fn set_utf8_config(&mut self, config: Utf8Config)
pub fn set_utf8_config(&mut self, config: Utf8Config)
Updates the tmux-style UTF-8 width and combining configuration.
Sourcepub fn set_alternate_screen_enabled(&mut self, enabled: bool)
pub fn set_alternate_screen_enabled(&mut self, enabled: bool)
Enables or disables DEC alternate-screen entry for subsequent output.
Sourcepub fn set_title_rename_enabled(&mut self, enabled: bool)
pub fn set_title_rename_enabled(&mut self, enabled: bool)
Enables or disables title changes requested by pane output.
Sourcepub fn set_input_buffer_limit(&mut self, limit: usize)
pub fn set_input_buffer_limit(&mut self, limit: usize)
Updates the tmux input-buffer-size parser limit.
Sourcepub fn resize(&mut self, size: TerminalSize)
pub fn resize(&mut self, size: TerminalSize)
Resizes the screen and resets the scroll region.
Sourcepub fn feed(&mut self, bytes: &[u8])
pub fn feed(&mut self, bytes: &[u8])
Feeds raw PTY output bytes through the private parser into the screen.
Sourcepub fn take_recovery_rebase_required(&mut self) -> bool
pub fn take_recovery_rebase_required(&mut self) -> bool
Returns and clears whether the latest feeds used terminal-parser state that an ANSI recovery keyframe cannot reconstruct.
Callers publishing raw continuation bytes must replace that continuation with an authoritative post-dispatch keyframe.
Sourcepub fn take_replies(&mut self) -> Vec<u8> ⓘ
pub fn take_replies(&mut self) -> Vec<u8> ⓘ
Returns and drains terminal replies generated while parsing PTY output.
Sourcepub fn pending_bytes(&self) -> Vec<u8> ⓘ
pub fn pending_bytes(&self) -> Vec<u8> ⓘ
Returns any bytes still buffered inside an incomplete parser state.
Sourcepub fn pending_bytes_ref(&self) -> &[u8] ⓘ
pub fn pending_bytes_ref(&self) -> &[u8] ⓘ
Borrows bytes buffered inside an incomplete parser state.
Sourcepub fn clone_recovery_screen(&self) -> Screen
pub fn clone_recovery_screen(&self) -> Screen
Clones renderer state, including bounded scrollback and saved buffers.
Sourcepub fn active_cell_state_ansi(&self) -> Vec<u8> ⓘ
pub fn active_cell_state_ansi(&self) -> Vec<u8> ⓘ
Returns ANSI restoring the parser’s active rendition and character sets.
Sourcepub fn active_cell_state_ansi_bounded(
&self,
max_hyperlink_bytes: usize,
) -> (Vec<u8>, bool)
pub fn active_cell_state_ansi_bounded( &self, max_hyperlink_bytes: usize, ) -> (Vec<u8>, bool)
Returns bounded ANSI for the active rendition and whether metadata was represented completely.
Sourcepub fn saved_cell_state_ansi(&self) -> Vec<u8> ⓘ
pub fn saved_cell_state_ansi(&self) -> Vec<u8> ⓘ
Returns ANSI restoring the rendition saved by DECSC/SCP.
Sourcepub fn saved_cell_state_ansi_bounded(
&self,
max_hyperlink_bytes: usize,
) -> (Vec<u8>, bool)
pub fn saved_cell_state_ansi_bounded( &self, max_hyperlink_bytes: usize, ) -> (Vec<u8>, bool)
Returns bounded ANSI for the saved rendition and whether metadata was represented completely.
Sourcepub fn saved_cursor_state(&self) -> (u32, u32, bool)
pub fn saved_cursor_state(&self) -> (u32, u32, bool)
Returns the cursor and origin mode saved by DECSC/SCP.
Sourcepub fn recovery_parser_state_ansi(&self) -> Vec<u8> ⓘ
pub fn recovery_parser_state_ansi(&self) -> Vec<u8> ⓘ
Returns ANSI restoring parser-owned state that has a faithful terminal representation, such as application-defined dynamic colours.
Sourcepub fn dynamic_colour(&self, slot: OscColourSlot) -> Option<&str>
pub fn dynamic_colour(&self, slot: OscColourSlot) -> Option<&str>
Returns an application-defined OSC 10/11/12 colour.
Sourcepub fn ground_timer_active(&self) -> bool
pub fn ground_timer_active(&self) -> bool
Returns whether the parser ground timeout is currently armed.
Sourcepub fn ground_timer_expired(&mut self)
pub fn ground_timer_expired(&mut self)
Notifies the parser that its ground timeout has expired.
Sourcepub fn take_terminal_passthrough(&mut self) -> Vec<TerminalPassthrough>
pub fn take_terminal_passthrough(&mut self) -> Vec<TerminalPassthrough>
Returns and drains passthrough events generated while parsing PTY output.
Sourcepub fn take_terminal_passthrough_dropped_count(&mut self) -> u64
pub fn take_terminal_passthrough_dropped_count(&mut self) -> u64
Returns and drains passthrough events dropped by parser safety limits.
Sourcepub fn reset_parser(&mut self)
pub fn reset_parser(&mut self)
Replaces the hidden parser with a fresh ground-state instance while preserving the current screen grid.