feat(tui): add configurable Kitty keyboard protocol mode #9242
+332
−51
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.
Summary
Add user-configurable Kitty keyboard protocol setting to resolve keybind issues on different terminals. Users can now choose between "auto", "enabled", or "disabled" modes based on their terminal's capabilities.
Problem
From issue #4997, users were experiencing inconsistent keybind behavior across different terminals:
ctrl+mand similar bindings not working on iTerm2/KittySolution
1. Configuration Schema
Added
kitty_keyboardfield to TUI configuration inpackages/opencode/src/config/config.ts:"auto" | "enabled" | "disabled""auto"(maintains current behavior)2. TUI Integration
Modified
packages/opencode/src/cli/cmd/tui/app.tsxto:useKittyKeyboardoption3. SDK Types
Regenerated SDK types to include new
tui.kitty_keyboardfield.Configuration Example
Users can now configure Kitty keyboard mode in their
opencode.json:{ "tui": { "kitty_keyboard": "enabled" }, "keybinds": { "model_list": "ctrl+m" // Now works reliably! } }Configuration Values
"auto"{}(best effort)"enabled"true"disabled"falseTesting
Resolves
#4997 (Keybinds)
🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.5 [email protected]