pub struct TerminalState {
pub title: String,
pub cwd: Option<Uri>,
pub cols: Option<i64>,
pub rows: Option<i64>,
pub content: Vec<TerminalContentPart>,
pub exit_code: Option<i64>,
pub claim: TerminalClaim,
pub supports_command_detection: Option<bool>,
}Expand description
Full state for a single terminal, loaded when a client subscribes to the terminal’s URI.
Fields§
§title: StringHuman-readable terminal title
cwd: Option<Uri>Current working directory of the terminal process
cols: Option<i64>Terminal width in columns
rows: Option<i64>Terminal height in rows
content: Vec<TerminalContentPart>Typed content parts, replacing the flat content: string.
Naive consumers that only need the raw VT stream can reconstruct it with:
content.map(p => p.type === 'command' ? p.output : p.value).join('')
Consumers that need command boundaries can filter by part type.
exit_code: Option<i64>Process exit code, set when the terminal process exits
claim: TerminalClaimWho currently holds this terminal
supports_command_detection: Option<bool>Whether this terminal emits terminal/commandExecuted and
terminal/commandFinished actions and populates command-typed parts.
Clients MUST check this flag before relying on command detection.
Do NOT use the presence of a command part as a feature flag — parts
are absent in the normal idle state.
Trait Implementations§
Source§impl Clone for TerminalState
impl Clone for TerminalState
Source§fn clone(&self) -> TerminalState
fn clone(&self) -> TerminalState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TerminalState
impl Debug for TerminalState
Source§impl<'de> Deserialize<'de> for TerminalState
impl<'de> Deserialize<'de> for TerminalState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for TerminalState
impl PartialEq for TerminalState
Source§fn eq(&self, other: &TerminalState) -> bool
fn eq(&self, other: &TerminalState) -> bool
self and other values to be equal, and is used by ==.