PowerShell wrapper breaks some common GNU command forms
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- powershell, rust
- Domain
- cli, operating-systems
Research direction
Start by reproducing the cat -- -dash.txt, grep, and cp cases with the PowerShell wrapper source at commit fe33724, then compare its argument handling with the release artifact. Check whether the wrapper can preserve the -- filename case and identify which other GNU/POSIX forms are shell-syntax limitations; done should include a verified fix or explicit wrapper documentation.
Written by the indexing model from the issue text.
Description
With the PowerShell wrapper enabled, I still hit a few GNU command lines that behave in surprising ways.
The clearest one is a filename starting with -:
Set-Content -LiteralPath '-dash.txt' -Value 'dash file foo'
cat -- -dash.txt
Expected:
dash file foo
Actual:
cat.cmd: '-dash': The system cannot find the file specified.
cat: .txt: The system cannot find the file specified.
It looks like -dash.txt is getting split into -dash and .txt. The same shape also fails for me with:
grep foo -- -dash.txt
cp -- -dash.txt dash-copy.txt
This workaround does work:
cat -- .\-dash.txt
grep foo -- .\-dash.txt
cp -- .\-dash.txt dash-copy.txt
I also ran into a few common GNU/POSIX forms that do not survive the wrapper:
find . \( -name "*.txt" -o -name "*.log" \) -print
find . -name "*.txt" -exec grep foo {} \;
[ -f a.txt ]
cat space\ name.txt
ls \[ab\].txt
Some of these are clearly PowerShell-vs-POSIX-shell syntax issues, so I am not claiming they are all coreutils bugs. But they are common command lines from GNU docs / muscle memory, and they are exactly the kind of cases users will try when using this project.
It would be useful either to handle the cases that can be handled, or to document the boundary of the PowerShell wrapper more explicitly. The -- -dash.txt case in particular looks like an argument-passing bug rather than just a POSIX shell compatibility limitation.
Environment:
- Windows 10.0.26200
- PowerShell 7.5.5
- Wrapper source tested from commit
fe33724 - Release artifact tested:
coreutils-2026.5.29-x64.exe - SHA256:
23B019D0664F1F5AA2A0C503435F8B52D3C8EEA2AEC1C0609CE21FCE18667281
- Dominant language
- Rust
- Stars
- 5.2k
- Forks
- 107
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/coreutils
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
sleep has 9MB Open
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
grep not work Open
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
All issues in microsoft/coreutils
Similar issues
-
bug CLI custom-model
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
rust-bitcoin/rust-bitcoin#6930 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
fulcrumgenomics/ferro-hgvs#2251 ·
-
A-allocators A-docs C-enhancement T-libs
Difficulty 2/5 1-3 hours Newbie friendliness 75/100