How do I open multiple instances of Visual Studio Code?

前端 未结 17 2801
长情又很酷
长情又很酷 2020-12-12 09:15

Today Microsoft released the Visual Studio Code file/folder editor.

The first limitation is it appears to be a single-instance application.

Is there a way of

相关标签:
17条回答
  • 2020-12-12 09:55

    Multiple instances of the same project

    WORKAROUND

    You cannot open multiple instances of the same folder but a workaround I have found is to open different folders.

    lib
    -components
    -models
    -helpers
    tests
    

    So, here I might open components, models and tests in different windows and then I can view them on my three monitors.

    It sounds a bit simple but this has helped me a lot.

    0 讨论(0)
  • 2020-12-12 09:56

    I came here to find out how to make VSCode (Mac OS) create a new window when a file or folder is opened and VSCode is already running. The same as GitHub Atom does. The answers above haven't answered my query, bit I've found answer myself so will share.

    Setting: window.openFilesInNewWindow - if set to on, files will open in a new window. window.openFoldersInNewWindow - if set to on, folders will open in a new window.

    Bonus to make it behave like Atom: Set window.newWindowDimensions to maximised.

    0 讨论(0)
  • 2020-12-12 09:57

    Use

    code -n
    

    when launching the program. This "Opens a new session of Visual Studio Code instead of restoring the previous session." (from here).

    The way I used this was by modifying my "Code" shortcut to include the -n parameter:

    0 讨论(0)
  • 2020-12-12 09:59

    Ctrl + Shift + P Duplicate Workspace in New Window Enter

    from: https://code.visualstudio.com/updates/v1_24#_duplicate-workspace-in-new-window

    0 讨论(0)
  • 2020-12-12 09:59

    Multiple VS Code windows can be opened on the same effective folder if each opens the folder through a different path. For example, on Windows, a project in C:\Git\MyProject could be open in one instance of VS Code, while \MyPC\c$\Git\MyProject is open in another instance. If the admin share (c$) isn't available or suitable, an explicit share can be constructed that provides the necessary access.

    No, this isn't an ideal solution.

    0 讨论(0)
  • 2020-12-12 10:01

    Starting with our 0.9.0 release, we added a new setting window.reopenFolders to control if Visual Studio Code should restore all folders of the previous session.

    By default only the last active window you worked on will be restored, but if you change this setting to all, Visual Studio Code will reopen all folders in their windows automatically.

    0 讨论(0)
提交回复
热议问题