microsoft / microsoft/WSL

Support quoted components in Windows %PATH%

Open
#2,155 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

  • Your Windows build number: 10.0.15063
  • What's going wrong: When invoking bash from a windows command prompt, the translation of the windows PATH environment variable is befuddled by quotes and/or spaces.
  1. Quoted paths in the PATH are dropped from bash's PATH :
C:\Users\nonpriv>path c:\Windows\System32;"c:\Program Files\nodejs"
C:\Users\nonpriv>node -v
v6.10.3
C:\Users\nonpriv>bash -c printenv | findstr PATH
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Windows/System32
C:\Users\nonpriv>bash -c node -v
-v: node: command not found
  1. Non-quoted paths containing spaces do appear inside the bash environment, but don't work properly:
C:\Users\nonpriv>path c:\Windows\System32;c:\Program Files\nodejs

C:\Users\nonpriv>bash -c printenv | findstr PATH
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Windows/System32:/mnt/c/Program Files/nodejs

C:\Users\nonpriv>bash -c node -v
-v: node: command not found

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce both quoted and unquoted PATH cases from a Windows command prompt using the provided path, bash, printenv, findstr, and node commands. Compare the resulting PATH and node lookup behavior; done means quoted and space-containing Windows PATH components are preserved and node -v works from bash. No source file or test is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.