mirror of
https://github.com/openai/codex.git
synced 2026-10-22 17:58:46 +00:00
## Why Windows non-TTY exec sessions reported interrupts as unsupported, so sending Ctrl-C through `write_stdin` did not stop the running process. ## What changed - Route interrupt requests for Windows non-TTY processes through their existing termination callback, including pipe-backed processes. - Track whether driver-backed Windows sessions use a TTY so PTY interrupts keep their existing behavior. - Consume the terminator after a successful interrupt to avoid invoking it again when the process handle is dropped. ## Testing Added coverage for local and remote exec-server sessions, unified exec, pipe fallbacks, and legacy Windows sandbox processes. GitOrigin-RevId: 34504d01f091ef57bb961e98ad5a8d9f1acee4ee
20 lines
526 B
Rust
20 lines
526 B
Rust
use super::*;
|
|
|
|
#[test]
|
|
fn process_fallback_interrupt_terminates_root() -> anyhow::Result<()> {
|
|
let mut child = std::process::Command::new("ping.exe")
|
|
.args(["-n", "60", "127.0.0.1"])
|
|
.stdin(Stdio::null())
|
|
.stdout(Stdio::null())
|
|
.stderr(Stdio::null())
|
|
.spawn()?;
|
|
let mut terminator = PipeChildTerminator {
|
|
windows: WindowsChildTerminator::Process(child.id()),
|
|
};
|
|
|
|
terminator.signal(ProcessSignal::Interrupt)?;
|
|
|
|
assert!(!child.wait()?.success());
|
|
Ok(())
|
|
}
|