mirror of
https://github.com/openai/codex.git
synced 2026-10-20 17:38:45 +00:00
## Why PTY launches need to establish a controlling terminal and reset signal state. Extend the Linux process setup helper to perform this work in a fresh, single-threaded process image without forking the application when the native helper is available. ## What changed - Add a PTY setup mode and support caller-owned stdout and stderr descriptors so all three standard streams use the PTY slave. - Use the helper for eligible Linux PTY launches, including launches with explicitly preserved descriptors, and wait for child exit asynchronously. - Preserve portable PTY behavior for `PATH` lookup, custom `argv[0]`, missing working directories, default `SHELL`, stdin EOF, and signal exit status. - Retain compatibility fallbacks and release the initial PTY descriptors before allocating a portable replacement. ## Testing Add regression tests for controlling-terminal setup without forking, portable signal exit status, and successful fallback under file-descriptor pressure. Resolve the Python test executable to an absolute path to exercise the helper path. GitOrigin-RevId: 4b07ce68aa33c5b79548581e221caf5953b0eda1