feat: add Cmd+O shortcut to open worktree in editor#1119
feat: add Cmd+O shortcut to open worktree in editor#1119arnestrickmann merged 5 commits intogeneralaction:mainfrom
Conversation
Adds a global keyboard shortcut (Cmd+O) that opens the current task's
worktree directory in the user's default editor (e.g., Cursor). The
shortcut triggers the same action as clicking the "Open" button in the
toolbar, with a tooltip showing the binding. For multi-agent tasks,
only the active agent's OpenInMenu responds to the shortcut. Also fixes
Cursor's open command to use `.` with cwd instead of {{path}} to avoid
path-splitting issues with spaces in directory names.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace native title tooltip (500ms delay) with Radix Tooltip component using instant visibility (0ms delay). Shows dynamic label like "Open in Cursor ⌘O" instead of generic text. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@lukecparr is attempting to deploy a commit to the General Action Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryThis PR adds a global Cmd+O keyboard shortcut to open the current worktree in the default editor. Key changes include:
The implementation is well-designed with proper event listener cleanup, correct React dependency arrays, and thoughtful handling of the single-task vs multi-agent rendering scenarios. Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| src/renderer/App.tsx | Added handleOpenInEditor callback that dispatches custom event, wired to keyboard shortcuts |
| src/renderer/components/titlebar/OpenInMenu.tsx | Added keyboard shortcut listener, Radix tooltip with instant display, and isActive prop for multi-agent coordination |
| src/renderer/hooks/useKeyboardShortcuts.ts | Added OPEN_IN_EDITOR shortcut definition (Cmd+O) with proper handler integration |
| src/shared/openInApps.ts | Changed Cursor's macOS command from cursor {{path}} to cursor . to avoid path-splitting on spaces |
Last reviewed commit: dc303b7
| <TooltipContent side="bottom" className="text-xs font-medium"> | ||
| Open in {buttonAppLabel || 'editor'} ⌘O | ||
| </TooltipContent> |
There was a problem hiding this comment.
Hardcoded ⌘O ignores non-Mac platforms
The tooltip text hardcodes ⌘O which is macOS-specific. On Windows/Linux, the shortcut resolves to Ctrl+O (since the matchesModifier function in useKeyboardShortcuts.ts maps 'cmd' to Ctrl on non-Mac platforms), but the tooltip still shows ⌘O.
This is consistent with other hardcoded ⌘ symbols in the codebase (e.g., GithubDeviceFlowModal.tsx, EditorMode.tsx), so it may be an accepted pattern — but worth noting as a potential UX gap if cross-platform polish is a goal.
| 'command -v cursor >/dev/null 2>&1 && cursor {{path}}', | ||
| 'open -a "Cursor" {{path}}', | ||
| ], | ||
| openCommands: ['command -v cursor >/dev/null 2>&1 && cursor .', 'open -a "Cursor" .'], |
There was a problem hiding this comment.
macOS-only change leaves win32/linux inconsistent
The Cursor open commands were changed from cursor {{path}} to cursor . only on macOS (to avoid path-splitting on spaces). The same spaces-in-paths issue could affect win32 and linux, which still use cursor {{path}}.
On macOS this works because exec sets cwd: target (in appIpc.ts:410), so . resolves correctly. The win32/linux commands also get the same cwd, so they could potentially benefit from the same . approach — but {{path}} is shell-quoted via quoted(), so it should handle spaces correctly too. Just noting the inconsistency.
|
Meant to open against my fork, apologies for the noise. |
Remove Linux-specific native deps step since this fork targets macOS only. Format-check job stays on ubuntu-latest as it's platform-agnostic. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The macOS runner ships Python 3.14 which removed the `distutils` module. node-gyp needs it to build native modules (node-pty). Pin Python 3.12 and install setuptools to provide the distutils compatibility shim. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No this is great. We should add cmd + shift + o or cmd + o for opening in default editor @arnestrickmann |
|
Yeah, already texted you on Linkedin @lukecparr after I saw the draft pr. this makes a lot of sense. |
|
@lukecparr if you reopen, consider whether it aligns with #1008 . We will overhaul shortcuts generally to align more with conventions 🙏 |
|
Reopened. Let me know if I should address either of the Greptile comments. This would be related in concept to #1008, but does not overlap since the issue doesn't cover shortcuts for opening in the IDE. |
Summary
.with cwd to avoid path-splitting on spacesTest plan
🤖 Generated with Claude Code