diff options
author | Jesse Luehrs <doy@tozt.net> | 2020-07-16 03:43:20 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2020-07-16 03:43:20 -0400 |
commit | 06e90f8e12f207b65df99e93b6a6ef27c999a137 (patch) | |
tree | 6421223fab19a1e229301b2c393403352a0fbc46 /examples | |
parent | 667878c1e186907b57b22b07b9f6d0e3ef76252a (diff) | |
download | pty-process-06e90f8e12f207b65df99e93b6a6ef27c999a137.tar.gz pty-process-06e90f8e12f207b65df99e93b6a6ef27c999a137.zip |
allow setting the terminal size
Diffstat (limited to 'examples')
-rw-r--r-- | examples/basic.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/examples/basic.rs b/examples/basic.rs index d3d795a..2f71bb4 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -4,9 +4,13 @@ use std::os::unix::io::AsRawFd as _; use pty_process::Command as _; fn main() { - let mut child = std::process::Command::new("cat") - // .args(&["--color=auto"]) - .spawn_pty() + let mut child = std::process::Command::new("perl") + .args(&[ + "-MTerm::ReadKey", + "-E", + "my @size = GetTerminalSize; say for @size", + ]) + .spawn_pty(Some(pty_process::Size::new(24, 80))) .unwrap(); let mut buf = [0_u8; 4096]; let pty = child.pty().as_raw_fd(); |