Expand description
Unified process handle types for PTY and pipe backends.
This module provides abstractions for interacting with spawned processes regardless of whether they use a PTY or regular pipes.
Inspired by codex-rs PTY process handle patterns (Apache-2.0).
Copyright 2025 OpenAI. See the repository THIRD-PARTY-NOTICES file for
full attribution.
§Async-drop pattern
Drop cannot be async, but some cleanup requires async operations
(e.g. asking a runtime to stop a process, removing a container, closing
a network connection). The pattern borrowed from testcontainers-rs is to
spin a dedicated thread inside Drop, create a temporary Tokio runtime on
that thread, and block the Drop call until the future resolves. This is
heavier than a true async drop, but it lets us bridge sync Drop into
async cleanup without requiring nightly Rust.
Structs§
- Process
Handle - Handle for driving an interactive or non-interactive process.
- PtyHandles
- Optional PTY-specific handles that must be preserved.
- Spawned
Process - Return value from spawn helpers (PTY or pipe).
Traits§
- Child
Terminator - Trait for process termination strategies.
Functions§
- collect_
output_ until_ exit - Collect output from a process until it exits or times out.
Type Aliases§
- Exec
Command Session - Backwards-compatible alias for ProcessHandle.
- Spawned
Pty - Backwards-compatible alias for SpawnedProcess.