Files
codex/codex-rs/utils/pty/Cargo.toml
viyatb-oai bf3eb2ec91 Prevent Unix PTY I/O from blocking runtime shutdown (#40460)
## Why

Blocking PTY reads and output-channel sends can keep Tokio runtime shutdown
waiting when a detached child retains the terminal or output backpressure fills
the channel.

## What changed

- Drive Unix PTY reads and writes through nonblocking `AsyncFd` readiness so
  their tasks can be cancelled during shutdown.
- Keep draining child output after its receiver closes, and preserve queued
  input plus EOF delivery when portable PTY stdin closes.
- Return a descriptive error when PTY spawning uses a Tokio runtime without an
  I/O driver.

## Testing

Add Unix coverage for detached children, full and dropped output channels,
large input with EOF, inherited file descriptors, and runtimes without I/O.

GitOrigin-RevId: f7f1f58abebf8bf1d39285cd61b8d69946d54155
2026-08-24 19:25:32 +00:00

41 lines
860 B
TOML

[package]
edition.workspace = true
license.workspace = true
name = "codex-utils-pty"
version.workspace = true
[lints]
workspace = true
[dependencies]
anyhow = { workspace = true }
portable-pty = { workspace = true }
tokio = { workspace = true, features = ["io-util", "macros", "net", "process", "rt-multi-thread", "sync", "time"] }
[dev-dependencies]
pretty_assertions = { workspace = true }
[target.'cfg(windows)'.dependencies]
filedescriptor = "0.8.3"
lazy_static = { workspace = true }
log = { workspace = true }
shared_library = "0.1.9"
winapi = { version = "0.3.9", features = [
"handleapi",
"jobapi",
"jobapi2",
"libloaderapi",
"minwinbase",
"processthreadsapi",
"synchapi",
"winbase",
"wincon",
"winerror",
"winnt",
] }
[target.'cfg(unix)'.dependencies]
libc = { workspace = true }
[lib]
doctest = false