Skip to content

feat(keybinding): rebind Cmd+T to duplicate focused panel#3421

Merged
gregpriday merged 3 commits intodevelopfrom
feature/issue-3415-rebind-cmd-t-duplicate-focused
Mar 16, 2026
Merged

feat(keybinding): rebind Cmd+T to duplicate focused panel#3421
gregpriday merged 3 commits intodevelopfrom
feature/issue-3415-rebind-cmd-t-duplicate-focused

Conversation

@gregpriday
Copy link
Collaborator

Summary

  • Rebinds Cmd+T (macOS) / Ctrl+T (Windows/Linux) from terminal.new to a new terminal.duplicateFocused action that clones the focused panel's kind and configuration into a fresh grid panel
  • terminal.new is rebound to Cmd+Shift+T / Ctrl+Shift+T to vacate the slot without conflicting with any existing bindings
  • The duplicate action reads the focused panel (falling back to the sole panel if nothing is focused), preserves worktree association for terminals and agent type for agent panels, and immediately focuses the new panel

Resolves #3415

Changes

  • shared/types/keymap.ts — adds terminal.duplicateFocused to the KeyAction union
  • src/services/KeybindingService.ts — rebinds terminal.new to Cmd+Shift+T and registers terminal.duplicateFocused at Cmd+T
  • src/services/actions/definitions/terminalActions.ts — adds terminal.duplicateFocused action using panelDuplicationService; buildPanelDuplicateOptions helper derives spawn options from the source panel's kind, worktree, and agent type
  • electron/menu.ts — updates the New Terminal menu item accelerator to CmdOrCtrl+Shift+T
  • src/hooks/useMenuActions.ts — wires terminal.duplicateFocused into the menu action map
  • src/services/__tests__/KeybindingService.test.ts — updated tests for new binding assignments
  • src/services/actions/actionDefinitions.adversarial.test.ts — adversarial coverage for the duplicate action across all panel kinds, empty grid, and fallback scenarios

Testing

Typecheck, lint ratchet (298 warnings, no new ones), and Prettier format check all pass. Unit tests cover the keybinding reassignment and the full terminal.duplicateFocused action paths including terminal/agent/browser/notes/dev-preview kinds, the single-panel fallback, and the empty-grid no-op.

gregpriday and others added 3 commits March 16, 2026 22:25
- Add terminal.duplicate to KeyAction union and KEY_ACTION_VALUES set
- Bind Cmd+T to terminal.duplicate, move terminal.new to Cmd+Alt+T
- Make terminal.duplicate argsSchema optional for keybinding dispatch
- Add three-tier target resolution: focused → lone panel → new terminal
- Update KeybindingService tests for new binding assignments
- Add adversarial tests for keybinding path and fallback behavior
…tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Use buildPanelDuplicateOptions for kind-specific state preservation
- Preserve title "(copy)" suffix after building duplicate options
- Update menu: Cmd+T → Duplicate Panel, Cmd+Alt+T → New Terminal
- Add duplicate-panel menu action mapping in useMenuActions
@gregpriday gregpriday force-pushed the feature/issue-3415-rebind-cmd-t-duplicate-focused branch from 7bd9ffe to d249a99 Compare March 16, 2026 11:26
@gregpriday
Copy link
Collaborator Author

Review status: Ready

Cross-PR holistic review — no file overlap or semantic conflicts with other open PRs (#3422, #3423, #3424). All 4 PRs are independent and safe to merge in any order.

@gregpriday gregpriday merged commit 65751e2 into develop Mar 16, 2026
4 checks passed
@gregpriday gregpriday deleted the feature/issue-3415-rebind-cmd-t-duplicate-focused branch March 16, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rebind Cmd+T to duplicate the focused panel

1 participant