Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Feat]: Way to invoke code-server with --disable-workspace-trust option. #5288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
GrahamDumpleton opened this issue Jun 22, 2022 · 1 comment · Fixed by #5638
Closed

[Feat]: Way to invoke code-server with --disable-workspace-trust option. #5288

GrahamDumpleton opened this issue Jun 22, 2022 · 1 comment · Fixed by #5638
Labels
enhancement Some improvement that isn't a feature
Milestone

Comments

@GrahamDumpleton
Copy link

What is your suggestion?

VS Code now has the workspace trust feature which requires a workspace to be trusted before working in it. Upstream VS Code does have a command line option --disable-workspace-trust to disable this feature:

but the same option is not available in code-server. Further, adding settings to:

  • ~/.local/share/code-server/User/settings.json

such as:

    "security.workspace.trust.banner": "never",
    "security.workspace.trust.untrustedFiles": "open"

have no effect since VS Code settings in the main are stored in the browser now and file based settings aren't used.

The ask is for a way to be able to disable workspace trust mechanism from the command line when running code-server.

Why do you want this feature?

Am embedding code-server in another hosted web application where precisely controlling what files are available and users needing to trust the workspace is not a great workflow and is unnecessary.

Further, we are using a VS Code extension which allows remote API access to automate actions in VS Code from the web application code-server is embedded in, such as open a file, but this extension's workflow is broken by the workspace trust feature because a file cannot be opened via the remote API until the workspace is trusted.

Are there any workarounds to get this functionality today?

No idea.

Are you interested in submitting a PR for this?

I have no knowledge on how it would be added.

@GrahamDumpleton GrahamDumpleton added the enhancement Some improvement that isn't a feature label Jun 22, 2022
@GrahamDumpleton
Copy link
Author

GrahamDumpleton commented Jun 22, 2022

Found was not using the correct setting. Need to set:

"security.workspace.trust.enabled": false

which isn't visible from UI settings page and have to work out can use it from VS Code docs.

A command line option --disable-workspace-trust would still make this easier for where want to disable it just for a single session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Some improvement that isn't a feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants