pub struct TerminalPane {
pub id: String,
pub host: String,
pub user: String,
pub cwd: String,
pub status: TerminalStatus,
pub lines: Vec<TerminalLine>,
}Expand description
A single pane rendered by MultiTerminal.
Fields§
§id: StringStable identifier used as the key in the broadcast set and event
target list. Must be unique across panes in a single MultiTerminal.
host: StringHostname shown in the header and prompt.
user: StringUsername shown in the prompt. Default: "user".
cwd: StringWorking directory shown in the prompt. Default: "~".
status: TerminalStatusConnection status. Default: TerminalStatus::Connected.
lines: Vec<TerminalLine>Scrollback buffer. Oldest line at index 0, newest at the end.
Implementations§
Source§impl TerminalPane
impl TerminalPane
Sourcepub fn new(id: impl Into<String>, host: impl Into<String>) -> Self
pub fn new(id: impl Into<String>, host: impl Into<String>) -> Self
Create a pane with the given id and hostname. Defaults: user "user",
cwd "~", status TerminalStatus::Connected, no lines.
Sourcepub fn cwd(self, cwd: impl Into<String>) -> Self
pub fn cwd(self, cwd: impl Into<String>) -> Self
Set the working directory shown in the prompt.
Sourcepub fn status(self, status: TerminalStatus) -> Self
pub fn status(self, status: TerminalStatus) -> Self
Set the connection status.
Sourcepub fn push(self, line: TerminalLine) -> Self
pub fn push(self, line: TerminalLine) -> Self
Append a line to the scrollback buffer (builder form).
Sourcepub fn push_line(&mut self, line: TerminalLine)
pub fn push_line(&mut self, line: TerminalLine)
Append a line at runtime.
Sourcepub fn set_status(&mut self, status: TerminalStatus)
pub fn set_status(&mut self, status: TerminalStatus)
Replace the connection status at runtime.
Sourcepub fn command_line(&self, cmd: impl Into<String>) -> TerminalLine
pub fn command_line(&self, cmd: impl Into<String>) -> TerminalLine
Build a command echo line targeting this pane. Convenience helper: the prompt pieces are filled from the pane’s own user/host/cwd.
Trait Implementations§
Source§impl Clone for TerminalPane
impl Clone for TerminalPane
Source§fn clone(&self) -> TerminalPane
fn clone(&self) -> TerminalPane
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more