Skip to content

fix: detect WSL remote for shell PATH resolution#9934

Merged
RomneyDa merged 1 commit intocontinuedev:mainfrom
shanevcantwell:fix/wsl-shell-path
Jan 31, 2026
Merged

fix: detect WSL remote for shell PATH resolution#9934
RomneyDa merged 1 commit intocontinuedev:mainfrom
shanevcantwell:fix/wsl-shell-path

Conversation

@shanevcantwell
Copy link
Contributor

@shanevcantwell shanevcantwell commented Jan 27, 2026

Summary

  • Add optional remoteName parameter to getEnvPathFromUserShell()
  • Use isWindowsHostWithWslRemote pattern (consistent with resolveCommandForPlatform) to allow shell PATH detection for WSL remotes

Problem

When Windows host connects to WSL remote, getEnvPathFromUserShell() was returning undefined because it only checked process.platform === "win32".

This caused MCP servers running in WSL to not get the user's shell PATH, potentially missing tools like npx, node, etc.

Test plan

  • Existing MCP tests pass
  • Manual: Windows host → WSL remote, MCP server resolves PATH from WSL shell

Fixes #9737

🤖 Generated with Claude Code


Continue Tasks: ▶️ 1 queued · ▶️ 1 not started — View all


Summary by cubic

Detect WSL remotes when resolving PATH from the user's shell. Ensures MCP servers running in WSL get the correct PATH on Windows hosts.

  • Bug Fixes
    • Added optional remoteName to getEnvPathFromUserShell and handled Windows host + WSL remote.
    • Used isWindowsHostWithWslRemote (consistent with resolveCommandForPlatform) to fetch PATH from the WSL shell.

Written for commit 939b44b. Summary will update on new commits.

When Windows host connects to WSL remote, getEnvPathFromUserShell() was
returning undefined because it checked only process.platform === "win32".

Add remoteName parameter to getEnvPathFromUserShell() and use the
isWindowsHostWithWslRemote pattern (consistent with resolveCommandForPlatform)
to allow shell PATH detection for WSL remotes.

Fixes continuedev#9737

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@shanevcantwell shanevcantwell requested a review from a team as a code owner January 27, 2026 01:51
@shanevcantwell shanevcantwell requested review from sestinj and removed request for a team January 27, 2026 01:51
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jan 27, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Copy link
Collaborator

@RomneyDa RomneyDa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thanks!

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs Jan 31, 2026
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 31, 2026
@RomneyDa RomneyDa merged commit 895632c into continuedev:main Jan 31, 2026
55 of 59 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Issues and PRs Jan 31, 2026
@github-actions github-actions bot locked and limited conversation to collaborators Jan 31, 2026
@sestinj
Copy link
Contributor

sestinj commented Feb 3, 2026

🎉 This PR is included in version 1.41.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm This PR has been approved by a maintainer released size:S This PR changes 10-29 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

shellPath.ts returns undefined for Windows even when connected to WSL

3 participants