[Windows] CTRL_C_EVENT not handled by bun (umbrella issue) #4297

Closed
opened 2026-02-16 17:43:19 -05:00 by yindo · 11 comments
Owner

Originally created by @kommander on GitHub (Jan 6, 2026).

Originally assigned to: @kommander, @Hona, @rekram1-node on GitHub.

This is to collect issues that are reporting ANSI escape sequences after CTRL+C in some windows terminals and shell, where it sends a CTRL_C_EVENT which is not handled by bun.

Originally created by @kommander on GitHub (Jan 6, 2026). Originally assigned to: @kommander, @Hona, @rekram1-node on GitHub. This is to collect issues that are reporting ANSI escape sequences after CTRL+C in some windows terminals and shell, where it sends a `CTRL_C_EVENT` which is not handled by bun. - https://github.com/anomalyco/opencode/issues/7062 - https://github.com/anomalyco/opencode/issues/6912
yindo added the windowsopentuibug labels 2026-02-16 17:43:19 -05:00
yindo closed this issue 2026-02-16 17:43:20 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 6, 2026):

This umbrella issue appropriately collects ANSI escape sequence issues related to CTRL_C handling. Additional related issues found:

  • #6189: In the Windows system, pressing Ctrl+C will automatically exit the terminal
  • #5990: Ctrl+C interruption causes terminal corruption with ANSI escape sequences
  • #3057: Ctrl+C should terminate child processes
  • #2999: Provide means to disable Ctrl-C (Windows quits app instead of copy)
  • #5071: Ctrl+C exiting app even when prompt input isn't empty

All of these appear to stem from improper CTRL_C_EVENT and signal handling on Windows. The umbrella issue structure is good for tracking the root cause.

@github-actions[bot] commented on GitHub (Jan 6, 2026): This umbrella issue appropriately collects ANSI escape sequence issues related to CTRL_C handling. Additional related issues found: - #6189: In the Windows system, pressing Ctrl+C will automatically exit the terminal - #5990: Ctrl+C interruption causes terminal corruption with ANSI escape sequences - #3057: Ctrl+C should terminate child processes - #2999: Provide means to disable Ctrl-C (Windows quits app instead of copy) - #5071: Ctrl+C exiting app even when prompt input isn't empty All of these appear to stem from improper CTRL_C_EVENT and signal handling on Windows. The umbrella issue structure is good for tracking the root cause.
Author
Owner

@Hona commented on GitHub (Jan 6, 2026):

on windows bun, the ctrl+c sigint gets sent to all process+childprocess, so the bun run wrapper instantly kills its child.
i need to check what happens with the published app too...
i have a bun wip branch that is a poc fixing this, but it janky.
not sure its something opentui/opencode can handle as a workaround if its parent process is killing it

@Hona commented on GitHub (Jan 6, 2026): on windows bun, the ctrl+c sigint gets sent to all process+childprocess, so the bun run wrapper instantly kills its child. i need to check what happens with the published app too... i have a bun wip branch that is a poc fixing this, but it janky. not sure its something opentui/opencode can handle as a workaround if its parent process is killing it
Author
Owner

@val-2 commented on GitHub (Jan 8, 2026):

Is this issue for collecting reports until the Bun team fixes it or are temporary workarounds in OpenCode also accepted?

@val-2 commented on GitHub (Jan 8, 2026): Is this issue for collecting reports until the Bun team fixes it or are temporary workarounds in OpenCode also accepted?
Author
Owner

@Hona commented on GitHub (Jan 8, 2026):

I have submitted a PR to the Bun team resolving this for us

@Hona commented on GitHub (Jan 8, 2026): I have submitted a PR to the Bun team resolving this for us
Author
Owner

@Hona commented on GitHub (Jan 8, 2026):

https://github.com/oven-sh/bun/pull/25876

I am seeing about adding tests.
Also need to investigate the wider impact of this change.
So there's more for me to do on this PR.
Hoping for guidance from the Bun team tho.

@Hona commented on GitHub (Jan 8, 2026): https://github.com/oven-sh/bun/pull/25876 I am seeing about adding tests. Also need to investigate the wider impact of this change. So there's more for me to do on this PR. Hoping for guidance from the Bun team tho.
Author
Owner

@carljuneau commented on GitHub (Jan 15, 2026):

oven-sh/bun#25876

I am seeing about adding tests. Also need to investigate the wider impact of this change. So there's more for me to do on this PR. Hoping for guidance from the Bun team tho.

Thanks for doing this! I press Ctrl+C out of habit and get kicked out 4-5x a day. Ugh.

@carljuneau commented on GitHub (Jan 15, 2026): > [oven-sh/bun#25876](https://github.com/oven-sh/bun/pull/25876) > > I am seeing about adding tests. Also need to investigate the wider impact of this change. So there's more for me to do on this PR. Hoping for guidance from the Bun team tho. Thanks for doing this! I press Ctrl+C out of habit and get kicked out 4-5x a day. Ugh.
Author
Owner

@tnglemongrass commented on GitHub (Feb 5, 2026):

Any progress on this?

I noticed that it only appears after update check, and that autoupdate: false doesn't properly skip it currently.

With that PR + autoupdate: false Ctrl+C just works as expected.

I'd be happy if someone could look into it.

@tnglemongrass commented on GitHub (Feb 5, 2026): Any progress on this? I noticed that it only appears after update check, and that `autoupdate: false` doesn't properly skip it currently. - Issue: https://github.com/anomalyco/opencode/issues/10538 - PR to fix the early exit: https://github.com/anomalyco/opencode/pull/10905 With that PR + `autoupdate: false` Ctrl+C just works as expected. I'd be happy if someone could look into it.
Author
Owner

@Hona commented on GitHub (Feb 6, 2026):

Yes, early next week a beta build will be running a bun fork which fixes the root cause :)

@Hona commented on GitHub (Feb 6, 2026): Yes, early next week a beta build will be running a bun fork which fixes the root cause :)
Author
Owner

@xiongxingplus commented on GitHub (Feb 6, 2026):

Come on, boss!

@xiongxingplus commented on GitHub (Feb 6, 2026): Come on, boss!
Author
Owner

@Hona commented on GitHub (Feb 12, 2026):

ctrl+c handling is now in as of 1.1.60

@Hona commented on GitHub (Feb 12, 2026): ctrl+c handling is now in as of 1.1.60
Author
Owner

@carljuneau commented on GitHub (Feb 13, 2026):

Works for me now. Thanks!

@carljuneau commented on GitHub (Feb 13, 2026): Works for me now. Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4297