Issue
VSCode restores a previously closed DevContainer session when opening a new project, even when the --new-window
flag is used and window.restoreWindows
is set to none
.
Steps to Reproduce
Open a project that uses DevContainers:
code my-project
Click the "Reopen in Container" popup.
Close the project using the window close (❌) button.
Verify that Docker containers have stopped using:
docker ps
Open a different project in a new window:
code --new-window my-new-project
Unexpected Behavior:
- Two windows open:
- One with
my-new-project
(expected). - Another with
my-project
reinitializing its DevContainer (unexpected).
- One with
- Two windows open:
Expected Behavior
- Only
my-new-project
should open. - The previously closed
my-project
DevContainer session should not be restored.
Additional Notes
This does not occur after a full OS reboot.
The issue persists even with the following settings:
{ "window.restoreWindows": "none", "workbench.editor.restoreViewState": false }
Environment
VSCode Version: 1.96.4
Commit: cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba
Electron: 32.2.6
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Linux x64 6.13.1-arch1-1
How can I prevent VSCode from restoring the previously closed DevContainer session when opening a new project?