最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

visual studio code - How to prevent VSCode from restoring previously opened devcontainer session - Stack Overflow

programmeradmin1浏览0评论

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

  1. Open a project that uses DevContainers:

    code my-project
    

    Click the "Reopen in Container" popup.

  2. Close the project using the window close (❌) button.

    • Verify that Docker containers have stopped using:

      docker ps
      
  3. Open a different project in a new window:

    code --new-window my-new-project
    
  4. Unexpected Behavior:

    • Two windows open:
      • One with my-new-project (expected).
      • Another with my-project reinitializing its DevContainer (unexpected).

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?

发布评论

评论列表(0)

  1. 暂无评论