microsoft / microsoft/WSL

please extend wslpath to handle network drives and the Linux filesystem

Open
#4,295 4 comments 8 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.18922.1000

  • What you're doing and what's happening:

At the moment, wslpath does not translate Windows paths to WSL paths for network drives, or to Windows paths for WSL paths outside non-network 9p filesystems.

i.e.

$ wslpath -u "Z:\test.txt"
wslpath: Z:\test.txt
[1]    742 exit 1     wslpath -u "Z:\test.txt"

and

$ wslpath -w "/usr/bin"
wslpath: /usr/bin
[1]    796 exit 1     wslpath -w "/usr/bin"

both fail.

  • What's wrong / what should be happening instead:

Since both of these files are accessible from WSL, wslpath should transform the names appropriately. In the case of the Windows network drive, presumably this could be done by comparing the UNC name to /proc/mounts, which gets you the relevant mount point if that network location is available in WSL. Going the other way, wslpath could supply UNC names under \wsl$\distro for any WSL file not on a 9p filesystem.

i.e., expected output should be

$ wslpath -u "Z:\test.txt"
/mnt/z/test.txt

and

$ wslpath -w "/usr/bin"
\\wsl$\Debian\usr\bin

I'm busy hacking on getting the equivalent of emacsclient to call up my WSL-side Emacs to edit files from the Windows command prompt, and while I can write code to translate the filenames myself, this really should be part of WSL itself, I think.

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

Start by locating the wslpath entry point and its existing path-conversion handling, then reproduce the network-drive and /usr/bin examples from the issue. Done means both directions produce the expected /mnt/z and \wsl$\Debian forms for accessible paths, with the existing behavior preserved for other paths.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.