In VS Code 1.57, I see this on the left of my status bar:
What is Restricted mode
and how I can I remove this from my status bar?
You will also see a Restricted Mode badge in the Status bar. Restricted Mode tries to prevent automatic code execution by disabling or limiting the operation of several VS Code features: tasks, debugging, workspace settings, and extensions.
Go to File > Preferences > Settings. Under drop-down Text Editor , search for Code Lens and disable it.
Search for “status bar” and check/uncheck the checkbox in the “Workbench > Status Bar: Visible” section to show/hide the status bar, respectively.
You can invoke these from the Command Palette (Ctrl+Shift+P) or the editor context menu. VS Code has default formatters for JavaScript, TypeScript, JSON, and HTML.
This will disable all prompts and trust mode features, making vscode behave exactly like it did before this feature was added.
GUI (ctrl ,)
security.workspace.trust.enabled
settings.json
"security.workspace.trust.enabled": false
At first glance, this new "Restricted Mode" seems unnecessary and obtrusive.
I believe its purpose is to prevent execution of untrusted code - e.g. as a result of an extension or using the "debug" option on an untrusted file. It seems to work in a similar manner to the restricted mode on MS Office apps, like MS Word, which restricts editing, saving and printing files until manually enabled.
From the Visual Studio Code documentation on Workspace Trust:
Restricted Mode tries to prevent automatic code execution by disabling or limiting the operation of several VS Code features: tasks, debugging, workspace settings, and extensions.
Personally, I have never come up against a situation where this would have been a problem and it seems like a constant nuisance for the sake of the one occasion it could be useful. That said, I imagine some people work with potentially dodgy files more often.
There are four new settings that allow us to customise this feature:
If you wanted to remove the feature, you can just switch off Trust, which "Controls whether or not workspace trust is enabled within VS Code". I have tried this and it does seem to completely disable this new feature - even removing related options from the command palette.
You can also control how VS Code works when opening an empty environment and how VS Code behaves with regards to untrusted files.
If you keep "Trust" enabled, you can also configure folders that you consider "safe" - for example your usual workspace, vs. your downloads folder.
Follow these steps to configure your trusted folders:
Workspaces: Manage Workspace Trust
and select the entry when it comes up.The release notes for VS Code v1.57 can be found on GitHub. There is also a specific page dedicated to workspace trust on code.visualstudio.com.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With