Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughModified internal key mapping to store both a Key and its Rune. Converted Changes
Sequence Diagram(s)(omitted — changes are internal mapping adjustments without multi-component sequential flow) Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #982 +/- ##
=======================================
Coverage 81.69% 81.69%
=======================================
Files 38 38
Lines 3922 3922
=======================================
Hits 3204 3204
Misses 575 575
Partials 143 143 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In @input.go:
- Line 345: Fix the incorrect inline comments in the keycode map: for the entry
with key 57415 (currently "57415: {Key: KeyRune, Rune: '='}, // KP_EQUAL
// KP_ENTER") remove the stray "// KP_ENTER" so it only reads KP_EQUAL, and for
the entry with key 57424 (comment currently "// KP_HOME") change the comment to
"// KP_END" to match the 57424 keycode; update only the comment text next to the
existing map entries (no code logic changes).
- Line 341: The map entry for KP_MULTIPLY is incorrectly using the divide rune;
locate the entry "57411: {Key: KeyRune, Rune: '/'}, // KP_MULTIPLY" and change
the Rune from '/' to '*' so KP_MULTIPLY maps to '*' (ensure KP_DIVIDE remains
'/' and no other keypad mappings are accidentally swapped).
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
input.go
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-01-06T15:44:36.396Z
Learnt from: gdamore
Repo: gdamore/tcell PR: 977
File: vt/emulate.go:150-150
Timestamp: 2026-01-06T15:44:36.396Z
Learning: In vt/emulate.go for DEC Private Mode 2 (PmVT52), the VT200/VT52 semantics are inverted: when the mode is OFF, VT52 mode is enabled; when the mode is ON, VT52 is disabled and VT100/ANSI mode is active. Ensure reviews verify that ModeOnLocked correctly enforces VT100/ANSI (VT52 disabled) when set, and that enabling OFF path activates VT52 mode. Document this inversion in code comments and tests, and avoid assuming a direct one-way mapping between PmVT52 and VT52 state. If any code branches rely on the opposite behavior, adjust tests accordingly.
Applied to files:
input.go
🧬 Code graph analysis (1)
input.go (1)
key.go (44)
Key(325-325)ModMask(305-305)KeyESC(497-497)KeyEnter(511-511)KeyBS(478-478)KeyCapsLock(420-420)KeyScrollLock(421-421)KeyNumLock(422-422)KeyPrint(352-352)KeyPause(353-353)KeyMenu(419-419)KeyF13(367-367)KeyF14(368-368)KeyF15(369-369)KeyF16(370-370)KeyF17(371-371)KeyF18(372-372)KeyF19(373-373)KeyF20(374-374)KeyF21(375-375)KeyF22(376-376)KeyF23(377-377)KeyF24(378-378)KeyF25(379-379)KeyF26(380-380)KeyF27(381-381)KeyF28(382-382)KeyF29(383-383)KeyF30(384-384)KeyF31(385-385)KeyF32(386-386)KeyF33(387-387)KeyF34(388-388)KeyF35(389-389)KeyRune(332-332)KeyLeft(336-336)KeyRight(335-335)KeyUp(333-333)KeyPgUp(342-342)KeyPgDn(343-343)KeyHome(344-344)KeyEnd(345-345)KeyInsert(346-346)KeyDelete(347-347)
🔇 Additional comments (2)
input.go (2)
136-140: LGTM!The addition of the
Runefield to the internalkeyMapstruct cleanly enables storing both the key type and its character representation for CSI-u keypad mappings.
1002-1016: LGTM!The updated logic correctly extracts both
KeyandRunefrom the newkeyMapstructure. The conditional handling properly distinguishes between:
- Special keys (e.g.,
KeyEnter) wherekey != KeyRune- Text keypad keys where
key == KeyRuneandchrcontains the ASCII characterThis achieves the PR objective of translating CSI-u private-area codes to their text equivalents.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
input.go (1)
357-357: Clarify the commented-out KeyBegin entry.The commented-out entry for
KeyBegin(code 57427) could benefit from a brief comment explaining why it's disabled—whetherKeyBeginis not yet defined in the codebase, not supported, or reserved for future use.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
input.go
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-01-06T15:44:36.396Z
Learnt from: gdamore
Repo: gdamore/tcell PR: 977
File: vt/emulate.go:150-150
Timestamp: 2026-01-06T15:44:36.396Z
Learning: In vt/emulate.go for DEC Private Mode 2 (PmVT52), the VT200/VT52 semantics are inverted: when the mode is OFF, VT52 mode is enabled; when the mode is ON, VT52 is disabled and VT100/ANSI mode is active. Ensure reviews verify that ModeOnLocked correctly enforces VT100/ANSI (VT52 disabled) when set, and that enabling OFF path activates VT52 mode. Document this inversion in code comments and tests, and avoid assuming a direct one-way mapping between PmVT52 and VT52 state. If any code branches rely on the opposite behavior, adjust tests accordingly.
Applied to files:
input.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
input.go (3)
136-140: LGTM! Clean extension of keyMap struct.The addition of the
Runefield tokeyMapprovides a flexible way to store both Key identifiers and their character representations, enabling the CSI-u keypad translation without disrupting existing mappings incsiAllKeys.
1002-1004: LGTM! Correct extraction of Key and Rune from keyMap.The code properly extracts both
KeyandRunefrom thecsiUKeysentries, enabling the downstream logic (lines 1011-1015) to correctly distinguish between functional keys (posting key events without strings) and text keypad keys (posting rune events with ASCII characters). This implements the PR objective of translating keypad CSI-u codes to their text values.
295-360: The keypad private-area code mappings are correct and match the Kitty keyboard protocol specification.All codes (57399–57426) have been verified against the official Kitty keyboard protocol. The implementation correctly maps keypad keys to their respective Private Use Area codepoints:
- Keypad digits (57399–57408) and operators (57409–57416) properly use
KeyRunewith corresponding ASCII values.- Navigation and function keys (57417–57426) properly map to specific
Keyconstants.- The commented-out
KP_BEGIN(57427) is a valid entry but may not yet be supported.
…lues (fixes #981)
Summary by CodeRabbit
Refactor
Chores
Note: No public APIs or user-facing interfaces were changed.
✏️ Tip: You can customize this high-level summary in your review settings.