fix: treat Windows del flags as case-insensitive - #13145
Open
tonycoder-hub wants to merge 1 commit into
Open
Conversation
Windows command switches and drive letters are case-insensitive, but the critical-command check for `del` compared `/s` and `/q` exactly and only lowercased one side of the system-drive comparison. As a result `del /s /q C:\` was disabled while the more idiomatic `DEL /S /Q C:\` and `del /Q C:/Windows` were merely gated behind a permission prompt. Co-authored-by: Tony Coder <407243179@qq.com>
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
This was referenced Aug 17, 2026
Author
|
I have read the CLA Document and I hereby sign the CLA |
Author
|
recheck |
cursor
Bot
force-pushed
the
cursor/fix-windows-del-flag-case-1913
branch
from
August 17, 2026 10:44
2302315 to
9b459aa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
isCriticalCommandalready blocks recursive/quietdelon the system drive, but it compared/s,/q, andc:/case-sensitively. Windows switches and drive letters are not case-sensitive, soDEL /S /Q C:\anddel /Q C:/Windowswere downgraded from always-blocked to ask-the-user.The argument list is now lowercased once before both checks. Existing lowercase matches are unchanged.
Distinct from #13143 (tar create-flag) and #13008 (blocklist expansion). #12429 does not touch the
delblock.Checklist
Tests
cd packages/terminal-security && npx vitest run→ 226 passed. Two new cases cover the uppercase switch/drive forms; they fail on unmodified source.