Open chrmarti opened 7 months ago
@sandy081 The documentation on when clauses mentions You can use any user or workspace setting that evaluates to a boolean here with the prefix "config.".
Does this also work for machine-scoped settings?
Yes, it should.
After more discussions we have now an updated proposal for this covering additional cases. Instead of using a VS Code setting, we can use a config file:
Case 1: The Dev Containers extension is only used for editing support for the devcontainer.json. To avoid having the Dev Containers extension offer to connect to a dev container a ~/.vscode-remote-containers/config.json
in the ssh user's home folder (on the ssh server) can be changed (created if needed) to contain:
{
"canConnectToContainer": false
}
Case 2: The Dev Containers extension is only used to connect to an existing dev container. To avoid having the Dev Containers extension offer to rebuild the dev container a ~/.vscode-remote-containers/config.json
in the ssh user's home folder (on the ssh server) can be changed (created if needed) to contain:
{
"canRebuildContainer": false
}
This is now available with Dev Containers 0.359.0-pre-release.
As other extensions are starting to support Dev Containers it would be helpful to have a way for them to disable the "reopen in container" parts of the Dev Containers UI while keeping the devcontainer.json editing support.
This could be done using a machine-scoped setting, e.g., for the case where Remote-SSH is used to connect to a dev container that was created using the Dev Container CLI.
Another option would be to use a marker inside the container, that might be more automatic than a machine-scope setting that has to be placed.