pub struct TerminalShellSnapshot {
pub shell_kind: ShellKind,
pub process_status: TerminalProcessStatus,
pub cwd_uri: Option<String>,
pub prompt_visible: bool,
pub current_command: Option<CommandExecution>,
pub last_command: Option<CommandExecution>,
pub command_history: Vec<CommandExecution>,
pub last_prompt_line: Option<u64>,
}Expand description
Cloned read model of current shell execution state.
Pending events, history limit, and next ID are deliberately omitted.
§Examples
use ailloli_ui_terminal_core::{ShellExecutionState, ShellKind};
let snapshot = ShellExecutionState::new().snapshot();
assert_eq!(snapshot.shell_kind, ShellKind::Unknown);
assert!(snapshot.command_history.is_empty());Fields§
§shell_kind: ShellKindCurrent shell family.
process_status: TerminalProcessStatusCurrent shell/PTY process status.
cwd_uri: Option<String>Current working-directory URI, or None when unknown.
prompt_visible: boolWhether a prompt is currently considered visible.
current_command: Option<CommandExecution>Running command, or None while idle.
last_command: Option<CommandExecution>Most recently finished command, retained independently of history limit.
command_history: Vec<CommandExecution>Retained finished commands, oldest to newest.
last_prompt_line: Option<u64>Most recent prompt global line, or None before detection.
Trait Implementations§
Source§impl Clone for TerminalShellSnapshot
impl Clone for TerminalShellSnapshot
Source§fn clone(&self) -> TerminalShellSnapshot
fn clone(&self) -> TerminalShellSnapshot
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TerminalShellSnapshot
impl Debug for TerminalShellSnapshot
Source§impl<'de> Deserialize<'de> for TerminalShellSnapshot
impl<'de> Deserialize<'de> for TerminalShellSnapshot
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TerminalShellSnapshot
impl PartialEq for TerminalShellSnapshot
Source§impl Serialize for TerminalShellSnapshot
impl Serialize for TerminalShellSnapshot
impl Eq for TerminalShellSnapshot
impl StructuralPartialEq for TerminalShellSnapshot
Auto Trait Implementations§
impl Freeze for TerminalShellSnapshot
impl RefUnwindSafe for TerminalShellSnapshot
impl Send for TerminalShellSnapshot
impl Sync for TerminalShellSnapshot
impl Unpin for TerminalShellSnapshot
impl UnwindSafe for TerminalShellSnapshot
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
Mutably borrows from an owned value. Read more