Skip to main content

TerminalScreen

Struct TerminalScreen 

Source
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

Source

pub fn new(size: TerminalSize, history_limit: usize) -> Self

Builds a fresh terminal screen with the given geometry and scrollback limit.

Source

pub fn screen(&self) -> &Screen

Returns a borrow of the structured screen grid.

Source

pub fn screen_mut(&mut self) -> &mut Screen

Returns a mutable borrow of the structured screen grid.

Source

pub fn plain_output_forwarding_safe(&self) -> bool

Returns whether plain printable output can bypass structured rendering without losing parser or screen semantics.

Source

pub fn set_utf8_config(&mut self, config: Utf8Config)

Updates the tmux-style UTF-8 width and combining configuration.

Source

pub fn set_alternate_screen_enabled(&mut self, enabled: bool)

Enables or disables DEC alternate-screen entry for subsequent output.

Source

pub fn set_title_rename_enabled(&mut self, enabled: bool)

Enables or disables title changes requested by pane output.

Source

pub fn set_input_buffer_limit(&mut self, limit: usize)

Updates the tmux input-buffer-size parser limit.

Source

pub fn resize(&mut self, size: TerminalSize)

Resizes the screen and resets the scroll region.

Source

pub fn feed(&mut self, bytes: &[u8])

Feeds raw PTY output bytes through the private parser into the screen.

Source

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.

Source

pub fn take_replies(&mut self) -> Vec<u8>

Returns and drains terminal replies generated while parsing PTY output.

Source

pub fn pending_bytes(&self) -> Vec<u8>

Returns any bytes still buffered inside an incomplete parser state.

Source

pub fn pending_bytes_ref(&self) -> &[u8]

Borrows bytes buffered inside an incomplete parser state.

Source

pub fn clone_recovery_screen(&self) -> Screen

Clones renderer state, including bounded scrollback and saved buffers.

Source

pub fn active_cell_state_ansi(&self) -> Vec<u8>

Returns ANSI restoring the parser’s active rendition and character sets.

Source

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.

Source

pub fn saved_cell_state_ansi(&self) -> Vec<u8>

Returns ANSI restoring the rendition saved by DECSC/SCP.

Source

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.

Source

pub fn saved_cursor_state(&self) -> (u32, u32, bool)

Returns the cursor and origin mode saved by DECSC/SCP.

Source

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.

Source

pub fn dynamic_colour(&self, slot: OscColourSlot) -> Option<&str>

Returns an application-defined OSC 10/11/12 colour.

Source

pub fn ground_timer_active(&self) -> bool

Returns whether the parser ground timeout is currently armed.

Source

pub fn ground_timer_expired(&mut self)

Notifies the parser that its ground timeout has expired.

Source

pub fn take_terminal_passthrough(&mut self) -> Vec<TerminalPassthrough>

Returns and drains passthrough events generated while parsing PTY output.

Source

pub fn take_terminal_passthrough_dropped_count(&mut self) -> u64

Returns and drains passthrough events dropped by parser safety limits.

Source

pub fn reset_parser(&mut self)

Replaces the hidden parser with a fresh ground-state instance while preserving the current screen grid.

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.