Fix PATH concatenation without separator in environment variable collection#958
Fix PATH concatenation without separator in environment variable collection#958
Conversation
…ction Co-authored-by: rchiodo <19672699+rchiodo@users.noreply.github.com>
Co-authored-by: rchiodo <19672699+rchiodo@users.noreply.github.com>
|
@copilot there's some prettier errors: Run npm run format-check
Checking formatting... |
Co-authored-by: rchiodo <19672699+rchiodo@users.noreply.github.com>
|
@copilot what's the steps to reproduce the bug? What causes this path environment variable concatenation? |
Steps to Reproduce:
Root Cause:
The Fix: |
There was a problem hiding this comment.
Should this be checked in? I believe the changes are only for handling the path and separators?
There was a problem hiding this comment.
@copilot there's an error here. Package-lock.json shouldn't have changed. Can you revert this change?
Fix PATH Separator Issue in Environment Variable Collection
noConfigDebugInit.tsSummary
Fixed a bug where the extension was incorrectly appending paths to the PATH environment variable without a leading separator, causing malformed PATH entries on Windows (e.g.,
npmc:instead ofnpm;c:).Root Cause
The code was checking
process.env.PATHto determine if a separator was needed, butcollection.append()appends to the environment variable collection's PATH, which can differ fromprocess.env.PATH.Solution
Always prepend the platform-specific separator (
;on Windows,:on Unix) when appending to PATH, ensuring proper concatenation regardless of the existing PATH state.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.