Skip to content

Copilot Chat extension corrupts remote $PATH on Linux by injecting Windows-style path with semicolon #286553

@tastynoob

Description

@tastynoob

Does this issue occur when all extensions are disabled?: No

  • VS Code Version: 1.107.1
  • OS Version: windows11

Description
When using Visual Studio Code with the Remote-SSH extension to connect to a Linux remote host, the $PATH environment variable in the integrated terminal becomes corrupted. This specifically breaks the code command from the VSCode Server CLI, preventing it from opening files on the local machine.

The root cause is that the GitHub Copilot Chat extension incorrectly injects a local Windows-style file path (e.g., c:\Users...) into the remote shell's $PATH. Crucially, this path is terminated with a Windows path separator (;).

Since Linux shells use a colon (:) as the path separator, the entire injected string (including the semicolon and the segment before the next actual colon) is interpreted as a single, invalid directory name. This corrupts the first path entry and, in the common case where the VSCode CLI path immediately follows, renders the code command unusable.

Image

Steps to Reproduce:

  1. Have the GitHub Copilot Chat extension installed and enabled locally.
  2. Connect to a Linux remote machine (e.g., Ubuntu) via Remote-SSH.
  3. Open an integrated terminal in the remote VSCode window.
  4. Run echo $PATH and observe the output.
  5. Run type -a code to see which code command is resolved.

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable bugcopilot-cli-agentBackground Agent related features/bugs

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions