add remote fleet terminal sessions
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user