aboutsummaryrefslogtreecommitdiffstats
path: root/src/command.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/command.rs')
-rw-r--r--src/command.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/command.rs b/src/command.rs
index 10de48e..cf1925d 100644
--- a/src/command.rs
+++ b/src/command.rs
@@ -14,7 +14,11 @@ impl Command for std::process::Command {
size: Option<&crate::pty::Size>,
) -> Result<Child> {
let pty = crate::pty::Pty::new()?;
- let pts = pty.pts(size)?;
+ if let Some(size) = size {
+ pty.resize(size)?;
+ }
+
+ let pts = pty.pts()?;
let pt_fd = pty.pt().as_raw_fd();
let pts_fd = pts.as_raw_fd();
@@ -74,6 +78,10 @@ impl Child {
pub fn pty(&self) -> &std::fs::File {
self.pty.pt()
}
+
+ pub fn pty_resize(&self, size: &crate::pty::Size) -> Result<()> {
+ self.pty.resize(size)
+ }
}
impl std::ops::Deref for Child {