feat(tui): add configurable Kitty keyboard protocol mode#9242
feat(tui): add configurable Kitty keyboard protocol mode#9242LIHUA919 wants to merge 2 commits intoanomalyco:devfrom
Conversation
Add tui.diff_display config option to collapse Edit/Write tool diffs by default, showing only file name and line statistics. - Add diff_display config (full | minimal) to Config.TUI - Add parseDiffStats() and formatDiffStats() utility functions - Enhance Edit tool with collapse/expand functionality - Enhance Write tool with collapse/expand functionality - Add comprehensive unit tests (12 tests, all passing) In minimal mode: - Edit: shows "+N, -M lines (press Enter to expand)" - Write: shows "N lines (press Enter to expand)" - Click to toggle between collapsed and expanded views - Full diff remains in metadata for AI context Fixes anomalyco#9089
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate Found:
Related PRs (different but relevant):
Recommendation: Check PR #8786 first as it directly addresses issue #4997. Verify that your PR's approach complements or doesn't duplicate that fix. |
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare
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 noreply@anthropic.com