add remote fleet terminal sessions

This commit is contained in:
lda
2026-07-15 07:33:37 +07:00 Verified
parent 4ecef8da38
commit 4d793136ba
24 changed files with 2386 additions and 26 deletions
+9 -1
View File
@@ -23,7 +23,7 @@ impl TerminalPty {
pty.resize(Size::new(rows, cols))
.context("failed to set initial PTY size")?;
let command = Command::new(program);
let command = Command::new(program).kill_on_drop(true);
let child = command
.spawn(pts)
.with_context(|| format!("failed to spawn {} in PTY", program.display()))?;
@@ -37,6 +37,14 @@ impl TerminalPty {
}
}
/// Resizes an owned PTY writer without exposing `pty-process` protocol types
/// to higher-level crates.
pub fn resize_terminal(writer: &OwnedWritePty, rows: u16, cols: u16) -> Result<()> {
writer
.resize(Size::new(rows, cols))
.context("failed to resize PTY")
}
#[cfg(test)]
mod tests {
use std::time::Duration;