Repository navigation
tmux stuff - #717
tmux stuff#717
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds routing that can forward Cmd-key shortcuts from the focused Ghostty terminal view to Ghostty instead of the app menu. A new predicate decides routing based on normalized modifiers, key/char, and terminal selection; NSWindow’s key-equivalent handler forwards qualifying events to Ghostty. Tests exercise these cases. Changes
Sequence DiagramsequenceDiagram
participant User
participant NSWindow
participant Router as shouldRouteTerminalCommandShortcutToGhostty()
participant Ghostty as Ghostty Terminal View
participant AppMenu as App Menu System
User->>NSWindow: Press Command+Key
NSWindow->>NSWindow: cmux_performKeyEquivalent
NSWindow->>NSWindow: Is Ghostty focused?
alt Ghostty focused
NSWindow->>Router: Evaluate (flags, chars/keyCode, selection)
alt Route to Ghostty
Router-->>NSWindow: true
NSWindow->>Ghostty: keyDown(with:event)
Ghostty->>User: Handle in terminal
else Route to App Menu
Router-->>NSWindow: false
NSWindow->>AppMenu: Dispatch to menu system
AppMenu->>User: Execute app action
end
else Not focused
NSWindow->>AppMenu: Dispatch to menu system
AppMenu->>User: Execute app action
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
cmuxTests/CmuxWebViewKeyEquivalentTests.swift (1)
2190-2207: Split the dual-assert test into separate test methods for sharper failures.
testRoutesOtherCommandShortcutsToTerminalcurrently validates two unrelated inputs. Splitting them makes failures more actionable during regressions.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@cmuxTests/CmuxWebViewKeyEquivalentTests.swift` around lines 2190 - 2207, Split the dual-assert test testRoutesOtherCommandShortcutsToTerminal into two distinct tests so each assertion fails independently: create one test (e.g., testRouteCommandOptionCToTerminal) that calls shouldRouteTerminalCommandShortcutToGhostty(flags: [.command, .option], chars: "c", keyCode: 8, terminalHasSelection: false) and asserts true, and a second test (e.g., testRouteCommandVToTerminal) that calls shouldRouteTerminalCommandShortcutToGhostty(flags: [.command], chars: "v", keyCode: 9, terminalHasSelection: false) and asserts true; keep the same parameters and expectations, just move each XCTAssertTrue into its own test method to improve test failure granularity.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@cmuxTests/CmuxWebViewKeyEquivalentTests.swift`:
- Around line 2190-2207: Split the dual-assert test
testRoutesOtherCommandShortcutsToTerminal into two distinct tests so each
assertion fails independently: create one test (e.g.,
testRouteCommandOptionCToTerminal) that calls
shouldRouteTerminalCommandShortcutToGhostty(flags: [.command, .option], chars:
"c", keyCode: 8, terminalHasSelection: false) and asserts true, and a second
test (e.g., testRouteCommandVToTerminal) that calls
shouldRouteTerminalCommandShortcutToGhostty(flags: [.command], chars: "v",
keyCode: 9, terminalHasSelection: false) and asserts true; keep the same
parameters and expectations, just move each XCTAssertTrue into its own test
method to improve test failure granularity.
Greptile SummaryThis PR adds support for custom tmux prefixes using Command-based keyboard shortcuts. The implementation introduces a new routing function Key changes:
The implementation follows existing patterns in the codebase (similar to Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Key Event] --> B{Local Event Monitor<br/>`handleCustomShortcut`}
B -->|Cmd+Q, Cmd+N, Cmd+T, Cmd+W<br/>handled| C[Event Consumed]
B -->|Pass through| D{`performKeyEquivalent`}
D --> E{Terminal focused?}
E -->|No| F[Normal event handling]
E -->|Yes| G{Font zoom shortcut?}
G -->|Yes| H[Route to terminal]
G -->|No| I{Browser event?}
I -->|Yes| J[Handle browser event]
I -->|No| K{**NEW: Command shortcut?**<br/>`shouldRouteTerminalCommand...`}
K -->|Cmd+, or<br/>Cmd+C with selection| L{Main menu check}
K -->|Other Cmd shortcuts| M[Route to terminal<br/>for tmux prefix]
L -->|Consumed by menu| C
L -->|Not consumed| F
Last reviewed commit: 253c196 |
This reverts commit a3681ed.
This reverts commit add3982.
Summary by CodeRabbit
New Features
Tests