繁體中文

新功能

刪檔案不再怕手滑,系統擋下危險指令還會跟你說原因

現在當你手滑下錯危險指令時,系統能更嚴密地把你攔下來,而且會清楚告訴你為什麼不讓你執行。這次擴充了危險指令偵測(dangerous-command detection,系統自動檢查並攔截破壞性動作的機制)的範圍,能抓出更多種刻意強硬使用 rm(Unix 系統中用來刪除檔案與目錄的指令)的寫法。而且,一旦你的指令被拒絕(denied),系統不再只丟出含糊的錯誤,而是會給出更清楚的拒絕理由。就像大樓的門衛,以前有人硬闖時可能偶爾會被他們漏看,而且擋下你時只會說「不行」;現在他們不但能識破更多種硬闖的假動作,把你攔下來時還會明確告訴你「因為這區在施工,所以禁止進入」。

English

FEATURE

Accidental deletions are blocked better, with clearer explanations when commands are rejected

When you accidentally type a destructive command, the system now stops you more reliably and explains exactly why it blocked you. This update expands dangerous-command detection (the safeguard that blocks destructive actions) to catch more variations of forced rm (the Unix command used to remove files and directories) forms. Furthermore, when your command is denied, it no longer just gives a vague error, but provides clearer rejection reasons. It's like a building security guard who used to occasionally miss people trying to force their way in and would only say "no" when stopping you; now they can spot more sneaky attempts to bypass security, and when they stop you, they explicitly tell you, "You can't enter because this area is under construction."

原始 CHANGELOG

Original changelog刪檔案不再怕手滑,系統擋下危險指令還會跟你說原因
Improved dangerous-command detection, including more forced `rm` forms, and provides clearer rejection reasons when commands are denied. (#33455)
#33455 [release/0.144] fix(core) expand is_dangerous_command @dylan-hurd-oai