Files
bun.sh/test/regression
Claude 0f44b738f8 fix(windows): forward CTRL+C events to child processes in bun run
On Windows, when `bun run` spawns a child process that inherits the
console, both the parent and child receive CTRL+C events simultaneously.
Previously, the parent process would handle CTRL+C and potentially exit
before the child process had a chance to handle the event gracefully.

This change registers a console control handler in the parent process
that ignores CTRL+C/CTRL+BREAK/CTRL+CLOSE events while a synchronous
child process is running. This allows the child process to handle these
events and exit gracefully, with the parent waiting for the child to
complete.

The implementation mirrors the existing POSIX signal forwarding pattern:
- CTRL_C_EVENT     -> SIGINT
- CTRL_BREAK_EVENT -> SIGBREAK (similar to SIGQUIT)
- CTRL_CLOSE_EVENT -> SIGHUP (console window closed)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 07:15:36 -08:00
..