Skip to content
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

Add setting or flag to disable "reopen in container" functionality #9734

Open
chrmarti opened this issue Apr 2, 2024 · 4 comments
Open

Add setting or flag to disable "reopen in container" functionality #9734

chrmarti opened this issue Apr 2, 2024 · 4 comments
Assignees
Labels
containers Issue in vscode-remote containers feature-request Request for new features or functionality
Milestone

Comments

@chrmarti
Copy link
Contributor

chrmarti commented Apr 2, 2024

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.

@chrmarti chrmarti added containers Issue in vscode-remote containers feature-request Request for new features or functionality labels Apr 2, 2024
@chrmarti chrmarti added this to the Backlog milestone Apr 2, 2024
@chrmarti chrmarti self-assigned this Apr 2, 2024
@chrmarti
Copy link
Contributor Author

chrmarti commented Apr 2, 2024

@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?

@sandy081
Copy link
Member

sandy081 commented Apr 4, 2024

Yes, it should.

@chrmarti
Copy link
Contributor Author

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
}

@chrmarti
Copy link
Contributor Author

This is now available with Dev Containers 0.359.0-pre-release.

@chrmarti chrmarti modified the milestones: Backlog, April 2024, May 2024 Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
containers Issue in vscode-remote containers feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

2 participants