Skip to content

Add 'Open in VS Code' button for session worktrees #6

@dhilgaertner

Description

@dhilgaertner

Summary

Add a button to the session view (near the "Mark as completed" button) that opens the session's primary worktree root in VS Code. The button should only appear if the code CLI command is detected on the system.

Behavior

Detection

  • On app launch (or lazily on first session view), check if code is available in PATH
  • Use which code or equivalent to detect installation
  • Cache the result so we're not shelling out on every render

UI

  • If code CLI is detected: show an "Open in VS Code" button in the session header area, alongside the existing "Mark as completed" button
  • If code CLI is not detected: hide the button entirely (don't show a disabled/greyed-out button)
  • Button should use a recognizable VS Code icon or a generic editor icon

Action

  • On click, run code {worktree_path} where worktree_path is the primary worktree's path for the current session
  • If the session has multiple worktrees, open the one marked as --primary
  • The command should run in the background and not block the UI

Notes

  • The code CLI is installed via VS Code's "Install 'code' command in PATH" action (Command Palette → Shell Command)
  • Common locations: /usr/local/bin/code, /opt/homebrew/bin/code, or wherever the user's PATH resolves it
  • This could later be extended to support other editors (Cursor, Zed, etc.) but for now just VS Code

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions