Skip to content

fix: support keybind overrides via plugin options - #7

Merged
bitIO merged 5 commits into
mainfrom
fix/keybind-overrides
Aug 12, 2026
Merged

fix: support keybind overrides via plugin options#7
bitIO merged 5 commits into
mainfrom
fix/keybind-overrides

Conversation

@bitIO

@bitIO bitIO commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Closes #5

Root cause

  • tui.json keybinds accepts ONLY built-in keybind names; unknown keys like balance.toggle are silently dropped by the host (dropUnknownKeybinds). Config keybinds can never target plugin commands, so the old override path was inert and the plugin's api.tuiConfig.keybinds.has(...) skip-logic was dead code.
  • The key parser treats uppercase as lowercase (uppercase != shift), so the default <leader>B was byte-identical to the built-in sidebar toggle <leader>b — the toggle actually toggled the sidebar.

Fix

  • Keybind overrides now live in plugin options: "keybind": "ctrl+b" (toggle) and "refreshKeybind": "ctrl+r" (refresh); "none" disables a binding.
  • Default toggle binding is now <leader>shift+b (truly distinct from the built-in sidebar toggle).
  • Removed the dead api.tuiConfig.keybinds.has() conditional; extracted pure buildCommandBindings(opts) with unit tests.
  • README updated (overrides via plugin options; tui.json keybinds documented as host-reserved).
  • User's ~/.config/opencode/tui.json updated to the new channel.

Verification

  • bun run typecheck, bun run build, bun test (47 pass) — all green locally; CI runs on this PR.

@bitIO
bitIO merged commit d4dfadf into main Aug 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plugin keybind overrides in tui.json do not take effect

1 participant