Skip to content

fix: treat Windows del flags as case-insensitive - #13145

Open
tonycoder-hub wants to merge 1 commit into
continuedev:mainfrom
tonycoder-hub:cursor/fix-windows-del-flag-case-1913
Open

fix: treat Windows del flags as case-insensitive#13145
tonycoder-hub wants to merge 1 commit into
continuedev:mainfrom
tonycoder-hub:cursor/fix-windows-del-flag-case-1913

Conversation

@tonycoder-hub

Copy link
Copy Markdown

Description

isCriticalCommand already blocks recursive/quiet del on the system drive, but it compared /s, /q, and c:/ case-sensitively. Windows switches and drive letters are not case-sensitive, so DEL /S /Q C:\ and del /Q C:/Windows were 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 del block.

Checklist

  • I've read the contributing guide
  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

Tests

cd packages/terminal-security && npx vitest run → 226 passed. Two new cases cover the uppercase switch/drive forms; they fail on unmodified source.

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>
@tonycoder-hub
tonycoder-hub requested a review from a team as a code owner August 17, 2026 10:17
@tonycoder-hub
tonycoder-hub requested review from sestinj and removed request for a team August 17, 2026 10:17
@github-actions

github-actions Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@tonycoder-hub

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@tonycoder-hub

Copy link
Copy Markdown
Author

recheck

@cursor
cursor Bot force-pushed the cursor/fix-windows-del-flag-case-1913 branch from 2302315 to 9b459aa Compare August 17, 2026 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant