Skip to content

CTRL+Y to view plan fails with code-insiders on WSL/Linux #1525

@philsphicas

Description

@philsphicas

Describe the bug

When pressing CTRL+Y to view the plan, copilot spawns code unconditionally
on Linux when VSCODE_IPC_HOOK_CLI or WSL_DISTRO_NAME is set. This fails
for users who have VS Code Insiders (code-insiders) but not regular VS Code.

The error:

✗ 'code' is not available. You can open the file manually at
/home/user/.copilot/session-state/<id>/plan.md

The issue is in the file-opening logic which hardcodes "code" as the
command for Linux+WSL/VS Code environments, without accounting for
code-insiders, code-exploration, or other variants.

Affected version

0.0.412-0

Steps to reproduce the behavior

  1. Install VS Code Insiders (but not regular VS Code) on WSL
  2. Open copilot-cli from the VS Code Insiders integrated terminal
    (which sets VSCODE_IPC_HOOK_CLI)
  3. Start a session that produces a plan
  4. Press CTRL+Y to view the plan

Expected behavior

Copilot should detect the correct VS Code variant. Possible approaches:

  • Parse VSCODE_IPC_HOOK_CLI to determine the variant
    (the path typically contains "insiders" for code-insiders)
  • Check for code-insiders / code in PATH order
  • Respect $VISUAL / $EDITOR environment variables
  • Fall back to xdg-open

Workaround

Create a symlink: ln -s "$(which code-insiders)" ~/.local/bin/code

Additional context

Related to #1038 (same underlying function), but a different failure mode.

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