Repository navigation
Fix unbound Cmd+Shift+key combos being silently swallowed - #1959
Conversation
Use charactersIgnoringModifiers instead of characters when redispatching Cmd-modified key events in performKeyEquivalent. Cmd-modified keys don't produce text characters, so event.characters returns an empty string for Cmd+Shift combos, preventing Ghostty from encoding them as kitty protocol sequences. charactersIgnoringModifiers returns the actual key character (e.g. "k" for Cmd+Shift+K) while modifiers are preserved in modifierFlags. Fixes manaflow-ai#1718 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Someone is attempting to deploy a commit to the Manaflow Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA single-line modification in the AppKit key-event redispatch logic changes the fallback character extraction from Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Greptile SummaryThis PR fixes a one-character bug in the two-pass
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant AppKit
participant PKE as performKeyEquivalent
participant KD as keyDown
Note over AppKit,KD: Unbound Cmd+Shift+Key (no cmux binding)
AppKit->>PKE: Pass 1
PKE->>PKE: is_binding check returns nil
PKE->>PKE: lastPerformKeyEvent is nil, store timestamp T
PKE-->>AppKit: false
AppKit->>PKE: Pass 2 (same event, timestamp T)
PKE->>PKE: lastPerformKeyEvent matches timestamp T
PKE->>PKE: Bug: event.characters was empty for Cmd-modified keys
PKE->>PKE: Fix: event.charactersIgnoringModifiers returns base character
PKE->>PKE: Build finalEvent with base char and original modifierFlags
PKE->>KD: keyDown(finalEvent)
KD-->>PKE: encodes key via kitty keyboard protocol
PKE-->>AppKit: true
Reviews (1): Last reviewed commit: "Fix Cmd+Shift+key combos being swallowed..." | Re-trigger Greptile |
…i#1959) Use charactersIgnoringModifiers instead of characters when redispatching Cmd-modified key events in performKeyEquivalent. Cmd-modified keys don't produce text characters, so event.characters returns an empty string for Cmd+Shift combos, preventing Ghostty from encoding them as kitty protocol sequences. charactersIgnoringModifiers returns the actual key character (e.g. "k" for Cmd+Shift+K) while modifiers are preserved in modifierFlags. Fixes manaflow-ai#1718 Co-authored-by: CHE-3 <schumannzheng@gmail.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
Cmd+Shift+keycombos (e.g. Cmd+Shift+K with no binding) were silently consumed and never reached the terminal via kitty keyboard protocolperformKeyEquivalentredispatch path usedevent.characterswhich returns empty string for Cmd-modified keysevent.charactersIgnoringModifierswhich returns the actual key character (e.g. "k"), while modifiers are preserved inmodifierFlagsWhy bound keys worked
Bound Cmd+Shift keys go directly through
keyDown(line ~5077), bypassing the redispatch path entirely. Only unbound keys hit the two-pass redispatch whereevent.characterswas used.Test plan
Fixes #1718
🤖 Generated with Claude Code
Summary by cubic
Fixes unbound Cmd+Shift+key combos being swallowed on macOS so the keys reach the terminal via the kitty keyboard protocol. Fixes #1718 while leaving existing keybindings unchanged.
event.charactersreturns an empty string for Cmd‑modified keys in theperformKeyEquivalentredispatch path.event.charactersIgnoringModifiersto get the base character while preservingmodifierFlags.Written for commit 1ce751f. Summary will update on new commits.
Summary by CodeRabbit