PowerShell wrapper breaks some common GNU command forms
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- powershell, rust
- Lĩnh vực
- cli, operating-systems
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện các trường hợp cat -- -dash.txt, grep và cp với mã nguồn wrapper PowerShell tại commit fe33724, sau đó so sánh cách xử lý đối số của wrapper với artifact của bản release. Kiểm tra xem wrapper có thể giữ nguyên trường hợp tên tệp -- hay không và xác định những dạng GNU/POSIX nào khác là giới hạn của cú pháp shell; kết quả hoàn thành phải bao gồm một fix đã được xác minh hoặc tài liệu wrapper rõ ràng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Rust
- Star
- 5.2k
- Fork
- 107
- Merge trung bình
- 2 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 4
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/coreutils
-
Add support for /dev/null Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
sleep has 9MB Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
grep not work Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
-
xargs: Error: Command could not be run: The filename or extension is too long. (os error 206) Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
Tất cả issue của microsoft/coreutils
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
TheLarkInn/aipm#2413 ·
-
documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
alexgorbatchev/simple-ptt#15 ·
-
tooling
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
todo:ticket
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
taikoxyz/taiko-mono#22168 · 1 bình luận ·