如何在 VSCode 中默认取消信任工作区?

How to untrust workspace by default in VSCode?

Workspace trust 在打开任意目录后打开一个对话框来中断工作流程。

要信任所有目录,只需通过启动 vscode 和命令行 --disable-workspace-trust

来禁用工作区信任功能

但是我如何 UNTRUST 任何 directory/workspace by default 没有侵入性对话?甚至更好,永久存储该设置? 如果我认为它是安全的,我以后总是可以信任它。


旁注,开发者已经声明 this 这很有趣:

"usage data showed a very low rate of granting trust through the passive notification. In user studies, we watched people spend all their time thinking they had broken something."

我已将使用此安全配置的文件和工作区的限制模式设置为默认


您可以将以下行添加到您的 settings.json

"security.workspace.trust.banner": "never",
"security.workspace.trust.startupPrompt": "never",
"security.workspace.trust.untrustedFiles": "newWindow",

或者启动 Visual Studio 代码的新实例并将文件拖放到该实例中。您将收到以下提示,您可以在其中勾选 Remember my decision for all workspaces 选项。

这将在您的 settings.json 中添加以下行:

"security.workspace.trust.untrustedFiles": "newWindow",

目前我正在使用Visual Studio代码1.59。