microsoft / microsoft/WSL

wslpath should accept input from stdin

Open
#2,929 4 comments 10 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

Windows build number: 17093.1000

What you're doing and what's happening:

# Current behaviour
wslpath "C:/Users/user"
# /mnt/c/Users/user

# Additional desired behaviour
echo "C:/Users/user" | wslpath
# /mnt/c/Users/user

# Should also work for the reverse conversion
echo "/mnt/c/Users/user" | wslpath -w
# C:\Users\user

I think the title and code snippet sum it up pretty well, but basically, the wslpath tool (which is fantastic addition btw) should accept input from stdin when an argument is not present. This will allow us to pipe paths into the tool in our scripts.

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 at the wslpath command entry point and inspect how it handles a supplied path argument and the -w reverse-conversion option. Add the no-argument stdin behavior for both conversion directions, then verify the command produces the paths shown in the issue when input is piped.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, operating-systems
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.