mirror of
https://github.com/openai/codex.git
synced 2026-11-28 23:34:06 +00:00
Allow ConPTY output to close after the last console client exits (#45504)
## Why Retaining the pseudoconsole's creation pipe handles prevents output readers from seeing EOF while the session remains alive. ## What changed Drop the creation handles after a successful process spawn and call `ReleasePseudoConsole` when available on Windows 11 24H2 or newer. This lets output close after the last attached client exits while preserving I/O for surviving console descendants. Older Windows versions retain the `ClosePseudoConsole` cleanup path on drop. ## Testing Add Windows lifecycle tests for output closure after normal exit and termination while retaining the session, plus continued input and output for a surviving console child. These tests skip when `ReleasePseudoConsole` is unavailable. GitOrigin-RevId: fb1094fb2a570e6fec0cc80d6356f5d7eb1edcbf
This commit is contained in:
1 parent
973ec2942c
commit
6ce16aadce
4 files changed
+168
-9
No files matched your search
@@ -185,7 +185,7 @@ impl MasterPty for ConPtyMasterPty {
|
||||
|
||||
impl SlavePty for ConPtySlavePty {
|
||||
fn spawn_command(&self, cmd: CommandBuilder) -> anyhow::Result<Box<dyn Child + Send + Sync>> {
|
||||
let inner = self.inner.lock().unwrap();
|
||||
let mut inner = self.inner.lock().unwrap();
|
||||
let child = inner.con.spawn_command(cmd)?;
|
||||
Ok(Box::new(child))
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user