## Why
Once the TUI restores the terminal, another Ctrl+C becomes a Windows
console event and can terminate Codex before it prints the exit summary,
including the resume hint when available. The npm launcher can also
force-terminate the child by forwarding a Ctrl+C that Windows already
delivered to it.
## What changed
Register a Windows Ctrl+C listener before restoring the terminal and keep
it alive until the CLI or standalone TUI finishes printing the exit
summary. Skip forwarding `SIGINT` from the npm launcher on Windows.
## Testing
Add a Windows regression test that simulates `SIGINT` in the npm launcher
and checks that the child can finish and report its own exit code.
GitOrigin-RevId: cd73a4a2ecc22812bc301787e67c349f7720a93b
## Why
The npm wrapper's spawn fallback stopped forwarding signals after the first one, preventing a second signal from interrupting a child's graceful shutdown.
## What changed
Remove the `child.killed` guard so the wrapper continues forwarding `SIGINT`, `SIGTERM`, and `SIGHUP` until the child exits.
## Testing
Add a regression test that forces the spawn fallback and verifies a running child receives a second `SIGTERM` and its numeric exit status is preserved.
GitOrigin-RevId: be96e784e2e4f419c43a5897d264f55fcdfd625f
## Why
Replacing the Node process lets the native binary receive signals and report its termination directly.
## What changed
- Use `process.execve` on non-Windows platforms when available, preserving CLI arguments and the prepared environment.
- Install a `SIGXFSZ` handler before replacement so the native binary gets the default signal disposition instead of inheriting Node's ignored signal.
- Retain asynchronous spawning for Windows and older Node versions.
## Testing
Extend the exit-status test to check that `execve` leaves no child process and that `SIGHUP` and `SIGXFSZ` terminate it with the original signal, while retaining coverage for the spawn fallback.
GitOrigin-RevId: 7437f15af419fce5b10c1c00425c7d38160991fc
## Why
The npm wrapper can exit successfully after its native child is terminated by a signal if Node ignores the re-emitted signal or a forwarding handler intercepts it.
## What changed
Set a fallback exit status of `128 + signal number` and remove listeners for the terminating signal before re-emitting it, preserving signal termination where supported.
## Testing
Add a non-Windows integration test using a built Codex binary to cover numeric argument-error exits, forwarded `SIGHUP` termination, and the fallback exit status for `SIGXFSZ`, which Node ignores by default.
GitOrigin-RevId: cad18a47aa50fd78517c367f8d8aae83bbbf7843