The problem
An agent works in instance fix-login and you want to read its diff, step through a test or poke at the running app in your editor. With several instances of one repo open, the windows all look alike, and an editor that attaches as the wrong user hits permission errors on the first save.
devsandbox vscode (or o in the dashboard) opens a window attached to the instance’s container, as the sandbox’s remoteUser, with the sandbox’s extensions, titled after the instance.
Try it
No config needed, only VS Code with the Dev Containers extension and code on your PATH. With instances fix-login and add-search running:
devsandbox vscode fix-login # a window titled fix-login
devsandbox vscode add-search # a second one, titled add-searchIn the dashboard, select an instance and press o, or type :code add-search.
How it works
- VS Code attaches to the container devsandbox already made, as
remoteUserif set. - Extensions in the sandbox’s
customizations.vscode.extensionsare installed on attach. - The window opens
/workspaces/<instance>.code-workspace, which is what names it. customizations.vscode.settingsis ignored (accepted but ignored): keep settings in the repo’s.vscode/settings.json.- Apple
containeris experimental: setdev.containers.experimentalAppleContainerSupporttotruein VS Code first.
Source: site/src/content/examples/vscode.mdxEdit this page on GitHub(opens in a new tab)