Skip to content

Can't distinguish git worktrees when calling /ide #1559

@bullmastiffo

Description

@bullmastiffo

Describe the bug

In repo with multiple git worktrees it's impossible to distinguish between those when trying to connect with /ide command.
CLI should autoconnect to worktree in which folder it is started.

Affected version

0.0.412

Steps to reproduce the behavior

  1. I have git repo with 2 extra worktrees except default (3 in total)
  2. I run cli in one of worktrees (not main)
  3. I want it to be connected to ide, because it's not automatically connected, so I type /ide
  4. What I see is 3 workspaces to connect to, but they all have the same name of root folder, so I have no idea how to pick one.
 Manage IDE Connection                                                                                                               │
│                                                                                                                                     │
│ Copilot CLI automatically connects to VS Code when its workspace matches your current folder.                                       │
│ • Folders trusted in VS Code are automatically trusted in the CLI                                                                   │
│ • CLI will have access to your editor selection and diagnostics                                                                     │
│ • File change approvals are shown in diff tabs you can approve or reject                                                            │
│ Use "Copilot CLI" commands in the VS Code command palette to access more features.                                                  │
│                                                                                                                                     │
│ Select an IDE workspace to connect to:                                                                                              │
│                                                                                                                                     │
│ ❯ 1. Visual Studio Code: /workspaces/repository                                                                                     │
│   2. Visual Studio Code: /workspaces/repository                                                                                     │
│   3. Visual Studio Code: /workspaces/repository                                                                                     │
│ ↑↓ to navigate · Enter to select · Esc to cancel         

when I pick any of them except the one that is related to main worktree I get an error:

✗ Failed to connect to IDE: Error: Failed to connect to IDE MCP server: Error: connect ECONNREFUSED /tmp/mcp-vkBCwh/mcp.sock

✗ Failed to connect to IDE: Error: Failed to connect to IDE MCP server: Error: connect ECONNREFUSED /tmp/mcp-FPBNUR/mcp.sock

EXPECTED:

  1. Automatically connect to right worktree (depending where cli is launched)
  2. Show worktrees in /ide list with proper names, so I can pick one.

Expected behavior

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions