| Crates.io | virtual-tty-pty |
| lib.rs | virtual-tty-pty |
| version | 0.1.0 |
| created_at | 2025-07-09 21:40:38.1087+00 |
| updated_at | 2025-07-09 21:40:38.1087+00 |
| description | PTY integration for virtual-tty - run real processes in virtual terminals |
| homepage | |
| repository | https://github.com/xavescor/virtual-tty |
| max_upload_size | |
| id | 1745542 |
| size | 12,281 |
PTY integration for virtual-tty - run real processes in virtual terminals for integration testing.
use virtual_tty_pty::PtyAdapter;
use std::process::Command;
// Create a PTY adapter
let mut pty = PtyAdapter::new(80, 24)?;
// Spawn a command
let mut child = pty.spawn_command(
Command::new("echo").arg("Hello from PTY!")
)?;
// Wait for completion
child.wait()?;
// Get the output
println!("{}", pty.get_snapshot());
use virtual_tty_pty::PtyAdapter;
use std::process::Command;
let mut pty = PtyAdapter::new(80, 24)?;
let mut child = pty.spawn_command(Command::new("bash"))?;
// Send commands
pty.send_input_str("echo 'Hello'\n")?;
pty.send_input_str("ls -la\n")?;
pty.send_input_str("exit\n")?;
child.wait()?;
This crate requires Unix-like systems (Linux, macOS) due to PTY API dependencies.
MIT