Skip to content

fix: detect WSL remote for shell PATH resolution - #9934

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

RomneyDa merged 1 commit into
continuedev:mainfrom
shanevcantwell:fix/wsl-shell-path

Conversation

@shanevcantwell

@shanevcantwell shanevcantwell commented Jan 27, 2026 •

Copy link
Copy Markdown
Contributor

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 <[email protected]>
@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

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

Copy link
Copy Markdown
Contributor

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

@RomneyDa RomneyDa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is great, thanks!

@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
53 of 57 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 31, 2026
@sestinj

sestinj commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

🎉 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

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants