[PR #13375] fix(tui): win32 - handle CTRL+BACKSPACE for word deletion #14634

Open
opened 2026-02-16 18:19:25 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/13375

State: open
Merged: No


Fixes #13368

Problem

On Windows, CTRL+BACKSPACE does not delete the preceding word in the TUI input field. This is because Windows Terminal doesn't properly set the ctrl modifier for backspace keypresses. ALT+BACKSPACE works as a workaround.

Solution

Add a platform-specific workaround that uses the Win32 GetAsyncKeyState API to check if CTRL is actually held when backspace is pressed, bypassing the terminal's incorrect modifier state.

Changes

  • Add win32IsCtrlHeld() function in win32.ts using user32.dll's GetAsyncKeyState
  • Handle CTRL+BACKSPACE in prompt input handler when on Windows and CTRL is detected via API
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/13375 **State:** open **Merged:** No --- Fixes #13368 ## Problem On Windows, CTRL+BACKSPACE does not delete the preceding word in the TUI input field. This is because Windows Terminal doesn't properly set the ctrl modifier for backspace keypresses. ALT+BACKSPACE works as a workaround. ## Solution Add a platform-specific workaround that uses the Win32 `GetAsyncKeyState` API to check if CTRL is actually held when backspace is pressed, bypassing the terminal's incorrect modifier state. ## Changes - Add `win32IsCtrlHeld()` function in `win32.ts` using `user32.dll`'s `GetAsyncKeyState` - Handle CTRL+BACKSPACE in prompt input handler when on Windows and CTRL is detected via API
yindo added the pull-request label 2026-02-16 18:19:25 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14634