opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Fix keybind parse missing super:false

Open opencode-agent[bot] opened this issue 2 weeks ago • 0 comments

The fix is complete. Here's a summary of the changes:

Summary

Root Cause: When parsing keybind strings like "ctrl+u", the Keybind.parse function was creating Info objects without a super field (it was undefined). This caused issues when these keybinds were passed to OpenTUI's textarea, where the missing super field (undefined) was interpreted differently than super: false, leading to unintended keybind conflicts.

The Fix:

  1. In packages/opencode/src/util/keybind.ts (line 67): Added super: false to the initial info object in the parse function. This ensures that all parsed keybinds explicitly have super: false unless they specifically include the "super" modifier in their keybind string.

  2. Updated all 15 test cases in packages/opencode/test/keybind.test.ts to include super: false in their expected results, ensuring the tests accurately reflect the new behavior.

Why this fixes the issue: When a user configures messages_half_page_up: "ctrl+u", the parsed keybind now explicitly has super: false. When this keybind is passed to OpenTUI's textarea via mapTextareaKeybindings, the super: false || undefined expression evaluates to undefined, but more importantly, OpenTUI now receives a consistent set of keybindings where the super modifier is always explicitly defined. This prevents cmd+backspace (which is super+backspace) from being incorrectly matched against keybinds that don't use the super modifier.

Closes #6650

New%20session%20-%202026-01-02T17%3A57%3A48.718Z opencode session  |  github run

opencode-agent[bot] avatar Jan 02 '26 18:01 opencode-agent[bot]