mirror of
https://github.com/openai/codex.git
synced 2026-05-02 04:11:39 +03:00
chore: close pipe on non-pty processes (#9369)
Closing the STDIN of piped process when starting them to avoid commands like `rg` to wait for content on STDIN and hangs for ever
This commit is contained in:
@@ -6,6 +6,7 @@ Lightweight helpers for spawning interactive processes either under a PTY (pseud
|
||||
|
||||
- `spawn_pty_process(program, args, cwd, env, arg0)` → `SpawnedProcess`
|
||||
- `spawn_pipe_process(program, args, cwd, env, arg0)` → `SpawnedProcess`
|
||||
- `spawn_pipe_process_no_stdin(program, args, cwd, env, arg0)` → `SpawnedProcess`
|
||||
- `conpty_supported()` → `bool` (Windows only; always true elsewhere)
|
||||
- `ProcessHandle` exposes:
|
||||
- `writer_sender()` → `mpsc::Sender<Vec<u8>>` (stdin)
|
||||
@@ -46,6 +47,7 @@ let exit_code = spawned.exit_rx.await.unwrap_or(-1);
|
||||
```
|
||||
|
||||
Swap in `spawn_pipe_process` for a non-TTY subprocess; the rest of the API stays the same.
|
||||
Use `spawn_pipe_process_no_stdin` to force stdin closed (commands that read stdin will see EOF immediately).
|
||||
|
||||
## Tests
|
||||
|
||||
|
||||
Reference in New Issue
Block a user