humanlayer icon indicating copy to clipboard operation
humanlayer copied to clipboard

Open Cursor Editor from Working Directory

Open dexhorthy opened this issue 4 months ago • 3 comments

Problem

Users want to seamlessly transition from CodeLayer to their IDE (Cursor) while maintaining the same directory context.

Proposed Solution

Add "Open in Cursor" action that launches Cursor at current PWD

(thanks @hellovai for the feedback!)

dexhorthy avatar Aug 22 '25 14:08 dexhorthy

i think we can do it next to archive "open in editor" with the lucide :pencil: icon - hotkey can be cmd+shift+e and it can do open - it can be next to the directory note in the header (we can move it later) - it should open the directory of the session

we also need a section in settings to determine which editor to use dropdown can have cursor,Code,Zed at the very least

this should use tauri-plugin-opener to do the opening

dexhorthy avatar Oct 07 '25 17:10 dexhorthy

@VAIBHAVSING

Couple bits of feedback on pr #730 -

  1. the visual styling in settings pane feels a little off - i can try to polish this a bit, but in general I'd prefer the clickable button looks more like the model selector button in the response editor, something like

Default Editor: [Cursor ✏️]

and clicking that opens the dropdown as is (I like the simple dropdown/combobox, thats fine for now, we can just use that in both places.

Image
  1. The UX in the response editor is fine for now, we might iterate it in the future, it's a little weird that its so far away from the text that shows the directory you're in, but I'm okay with that for now

but far more importantly -

  1. I have cursor installed on my machine but this doesn't work for me on macOS, probably because i don't have the cursor cli installed - this should work with the bare minimum config, which means rather than cursor DIR we should probably see if its possible to use the tauri plugin-opener functionality - did you try that?

VS Code doesn't work either. zed does work. Awesome! I assume thats cause zed always installs a CLI, or perhaps i enabled this when i first installed zed last year.

For extra background, in my personal shell, I have cursor aliased to open -a Cursor.app so cursor DIR translates to open -a Cursor.app DIR (but ofc this wont work for invoking a shell cmd from rust/tauri).

request

It may be more valuable to collaborate on a /create_plan document together rather than the code itself, so we can align on the approach before you get to coding. You can create a plan from the existing code to capture the changes.

i don't have strong preference on how you share the plan, but you could include it in the PR so we could collaborate on it before you start coding.

An example prompt to get started w/ claude code:

/create plan I want to adapt existing PR (use gh pr view) to see the current status and changes to incorporate the comments from issue #479 

don't make any code changes just create the plan - work back and forth with me to design the change plan

dexhorthy avatar Oct 19 '25 16:10 dexhorthy

Implementation Update for PR #730

I've addressed the feedback from the PR review with the following key improvements:

✅ Changes Implemented

  1. Switched to tauri-plugin-opener for cross-platform compatibility

    • Removed custom shell command logic (400+ lines)
    • Now uses native Tauri opener API for reliable editor launching
    • Works on macOS without requiring CLI tools to be installed
    • Platform-specific app name mapping (e.g., "Visual Studio Code" on macOS, "Code" on Windows)
  2. Changed default editor from Cursor to VS Code

    • Updated default in preferences
    • VS Code is more commonly installed across platforms
  3. Fixed keyboard shortcut display

    • Changed from ⌘+Shift+E to ⌘⇧E to match codebase style
    • Now consistent with other keyboard shortcuts in the app
  4. Added proper hotkey scope configuration

    • Added HOTKEY_SCOPES.SESSION_DETAIL and SESSION_DETAIL_ARCHIVED scopes
    • Added enableOnContentEditable: true for proper editor integration
    • Hotkey now properly scoped to session detail views

📝 Commits

  • 7f04001 - refactor: use tauri-plugin-opener for editor launch
  • d91d221 - feat: change default editor to VS Code
  • b7bf598 - fix: use unicode shift character in keyboard shortcut
  • 857218f - fix: add proper hotkey scope and contentEditable support

🔄 Remaining Work

The Settings UI improvements are not yet implemented. This requires:

  • Making the editor selector match the model selector button style
  • Improving focus states for better readability
  • Fixing padding and indentation issues

I plan to address the UI improvements in a follow-up commit after getting feedback on the core functionality changes.

🧪 Testing Needed

Please test on macOS to verify that editors open correctly without CLI tools installed. The new implementation should work with just the applications installed in /Applications.

cc @dexhorthy @K-Mistele - ready for review!

VAIBHAVSING avatar Nov 03 '25 12:11 VAIBHAVSING