tui: remove the win32 ENABLE_PROCESSED_INPUT ffi shim - #43604
Merged
Conversation
Contributor
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
Contributor
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
Jarred-Sumner
force-pushed
the
claude/ffi-buffer-args
branch
from
August 20, 2026 08:42
4107790 to
1b870ae
Compare
Hona
enabled auto-merge (squash)
August 20, 2026 08:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Refactor — removes a workaround for oven-sh/bun#31941 / #13052-era Bun behaviour. No opencode issue.
Type of change
What does this PR do?
Heads up: this is speculative and Claude wrote it; it has not been run on Windows. Posting it from the Bun side because we think the shim is redundant and want to know if it isn't.
Deletes
packages/tui/src/terminal-win32.{ts,bun.ts,node.ts}and its two call sites (win32DisableProcessedInput()aftercreateCliRenderer(),win32FlushInputBuffer()at exit). The pollingwin32InstallCtrlCGuard()already had no callers onv2.Why it shouldn't be needed: opentui's renderer calls
process.stdin.setRawMode(true). On Windows, in both Bun and Node, that's libuvuv_tty_set_mode(UV_TTY_MODE_RAW_VT)→SetConsoleMode(stdin, ENABLE_WINDOW_INPUT | ENABLE_VIRTUAL_TERMINAL_INPUT), which already clearsENABLE_PROCESSED_INPUT, so Ctrl+C arrives as\x03on stdin and noCTRL_C_EVENTis generated. Neither runtime re-adds the flag afterwards. The shim re-did that by hand viadlopen("kernel32.dll"), and its old 100 ms Get/SetConsoleMode poller is what triggered oven-sh/bun#31941.Bun fixes that landed after #13052: oven-sh/bun#30288 (
process.stdin.isRawnever set on Windows → teardown paths re-cooked stdin on a later tick), oven-sh/bun#33527 (raw-mode state per handle). The remaining related Bun bug —bun run <script>/ the global-bin.exeshim exiting onCTRL_C_EVENTwhile the child keeps running (oven-sh/bun#11400) — is oven-sh/bun#39729; it only affects a raw-mode TUI if something else turnedENABLE_PROCESSED_INPUTback on.If Ctrl+C regresses on Windows with this, we'd rather get a Bun bug report than keep an ffi workaround here.
How did you verify your code works?
Read-through only (Bun's
Source__setRawModeStdin→ libuvuv_tty_set_modeflags, opentuirenderer.tsraw-mode calls). Not run on Windows — needs someone with a Windows box to confirm Ctrl+C still clears the prompt / exits.Screenshots / recordings
n/a
Checklist