Skip to content

Open IDE in Session Working Directory (/ide enhancement or keyboard shortcut) #1308

@rogerbarreto

Description

@rogerbarreto

Describe the feature or problem you'd like to solve

When working with multiple Copilot CLI sessions across different repositories, worktrees, or branches, there's no quick way to open an IDE directly in the session's working context. Currently, users must manually navigate to the correct directory and launch their IDE, breaking the workflow.

The existing /ide command does not open a new IDE instance in the session's CWD - this gap leads to friction when reviewing diffs, code changes, or making manual edits in the context of a specific agent session.

Proposed solution

Extend the /ide command (or add a new keyboard shortcut like Ctrl+I) to launch the user's preferred IDE in the session's working directory.

Key capabilities:

  • Multiple IDE support - Allow users to configure their preferred IDE (VS Code, Visual Studio, JetBrains, etc.)
  • Flexible context options:
    • Session CWD - Open IDE at the current working directory of the session
    • Repository root - Open IDE at the git repository root
    • Invocation directory - Open IDE at the original directory where Copilot CLI was started
  • Dual triggers:
    • Keyboard shortcut (e.g., Ctrl+I or Ctrl+Shift+O)
    • Slash command /ide or /ide open

Configuration example:

copilot config set ide.editor "code"  # or "code-insiders", "devenv", "idea"
copilot config set ide.default-context "cwd"  # or "repo-root", "invocation-dir"

Example prompts or workflows

  1. Multi-worktree workflow:

    • User has 3 terminals with Copilot CLI in different git worktrees
    • In session 2, agent makes changes to src/auth/login.ts
    • User presses Ctrl+I → VS Code opens at that worktree's root
    • User reviews diff in IDE, makes tweaks, returns to CLI
  2. Branch-specific review:

    • Copilot CLI session is in feature/new-api branch
    • User types /ide to open IDE in current context
    • IDE opens with the branch already checked out at the correct directory
  3. Quick file inspection:

    • Agent reports "I've updated package.json"
    • User types /ide . or presses keyboard shortcut
    • IDE opens in session CWD, user can immediately see the file
  4. Configurable context:

    • User prefers VS Code: copilot config set ide.editor "code"
    • User types /ide --repo-root to open at repository root instead of CWD
  5. Cross-IDE support:

    • Team member uses Visual Studio: copilot config set ide.editor "devenv"
    • Same /ide command works, opens Visual Studio instead

Additional context

Current behavior gap:
The /ide command exists but does not open a new IDE instance in the session's working directory context. Users discovering this command expect it to solve this exact use case.

User pain points addressed:

  • Managing multiple CLI sessions across different repos/worktrees/branches
  • Context-switching friction when needing to review code in an IDE
  • Having to manually cd and launch IDE loses the mental model of "this session = this context"

Similar patterns in other tools:

  • VS Code's "Open in Terminal" opens terminal at file location
  • GitHub Desktop's "Open in VS Code" opens IDE at repo root
  • code . command already exists but requires knowing the correct directory

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions