Skip to content

Support to open a project folder in multiple VS Code windows #2686

Closed as not planned

Description

@weinand

Currently VS Code prevents opening a folder more than once which makes it impossible to work on a project in multiple windows (e.g. on multiple displays).

Benjamin Pasero (@bpasero) Dirk Bäumer (@dbaeumer) Erich Gamma (@egamma) alexandrudima please raise any obstacles and issues you might foresee with this request.

Issues found so far:

  • we use the workspace path as identifier to communicate back from debug target to debug host
  • we need to verify cross platform that there is no code causing issues when running over the same root folder (e.g. file watchers)

Please note: Initially I've created this feature request for a specific use case: enable debugging of multiple processes.
In the meantime, debugging of multiple processes has become possible without the need for opening a folder more than once (see #13426). But instead of closing this item (as no longer necessary), I've repurposed it by removing the specific debug use case.
For transparency you can find the original comment below:

Currently it is not possible to debug more than one process from a single VS Code project (= window)
because VS Code prevents opening a folder more than once.

The workaround is to open VS code on a subfolder within the original folder, which means to restructure the project (which is not desirable).

This feature request asks for lifting the constraint and allowing to open a project folder multiple times.

Activity

  1. added
    feature-request
    on Feb 3, 2016
  2. Tyriar commented on Feb 3, 2016

    @Tyriar
    Contributor

    I think this is a duplicate of #48

  3. weinand commented on Feb 3, 2016

    @weinand
    ContributorAuthor

    Daniel Imms (@Tyriar) yes, on first glance this looks like a duplicate. However this request is specifically targeted towards a concrete use case: enable debugging of multiple processes.

    I do not want to discuss why this is necessary or what the name of a setting to enable this should be. I just want to discuss what is needed to make VS Code support this scenario without any problematic side effects.

    Benjamin Pasero (@bpasero) is the right person to resolve this as a duplicate of #48 or not,

  4. bpasero commented on Feb 4, 2016

    @bpasero
    Contributor

    I think this request is fair because it talks about lifting our current limitation that you cannot open the same folder twice in 2 or more windows.

    Andre Weinand (@weinand) I suggest we add the issues we see to your first comment so that we do not have to haunt down all the issues by checking the comments.

  5. stereokai commented on May 10, 2016

    @stereokai

    Benjamin Pasero (@bpasero) How about this? Is this a feature that a contributor can solve or only core team members?

  6. bpasero commented on May 10, 2016

    @bpasero
    Contributor

    This is not an area where we would easily accept PRs, sorry. It needs more thinking than just allowing to open the same folder in multiple windows. People might expect this to be a very light weight operation because the folder is already open in one window. In fact, the 2 windows share nothing and so you end up with multiple language services. I find this OK but not everyone in the team currently would agree to that.

  7. stereokai commented on May 13, 2016

    @stereokai

    Benjamin Pasero (@bpasero) I understand. Well then, hope this feature comes out soon, would contribute a lot to users with multi-monitor setups

  8. hackwaly commented on Jun 24, 2016

    @hackwaly

    I found a workaround - use ln -s.

  9. bpasero commented on Oct 13, 2016

    @bpasero
    Contributor

    Some notes:

    • Distinct user interaction only from File > Open Folder?
    • Show a prompt to warn the user when this happens?
    • How to support API to force open the same workspace in a new window?
    • What does it mean for Window settings or local storage that are associated?
  10. 111 remaining items

  11. jcklpe commented on Aug 27, 2018

    @jcklpe
  12. Nowaker commented on Aug 30, 2018

    @Nowaker

    @thedonquixotic's solution works. But this is so inconvenient to those who don't know about it. Trying to open the same directory should result in just that - a new window with the given directory. Likewise, code -n . from command line should create a new window. This doesn't work currently.

  13. chriskuech commented on Oct 25, 2018

    @chriskuech

    I believe there was a recent "feature" that regressed this behavior, contrary top what is described above.

    I open VS Code by cding into my workspace and running code .. This would open the folder/workspace, as opposed to code .\myFile.ext opening the single file without the context of a workspace. VS Code now seems to infer the workspace from the file, so code .\myFile.ext and code . are now equivalent and therefore the workspace would have one window open. This prevents CLI users from opening up a single file in a new window, as users above recommend.

  14. FernandoMiguel commented on Oct 25, 2018

    @FernandoMiguel

    Chris Kuech (@chriskuech) I'm on the nightly builds and I still see the same behaviour.
    Do keep in mind that if you already have a workspace open, individual files will open there

    Maybe -n can force a word a new empty workspace

  15. chriskuech commented on Oct 25, 2018

    @chriskuech

    Thanks Fernando Miguel (@FernandoMiguel) , it seems code -n .\myFile.ext successfully opens a new window containing myFile.ext, even when an existing workspace is open.

  16. ConnectivityChris commented on Nov 14, 2018

    @ConnectivityChris

    Possible workaround that might be useful to anyone wanting to have two folders open is to use Live Share and join your own session.

    This allows multiple windows to be open simultaneously (With the only downside being always online requirements)

  17. bpasero commented on Nov 24, 2018

    @bpasero
    Contributor

    I would argue invoking our command "Duplicate Workspace in New Window" (see https://code.visualstudio.com/updates/v1_24#_duplicate-workspace-in-new-window) is easier than having to join a live share session?

    image

  18. jcklpe commented on Nov 24, 2018

    @jcklpe

    Yeah, this issue is pretty much solved, but people keep on skipping all the discussion and don't see that aside from being able to invoke this from CLI, the issue is fixed.

    For future generations:
    👆☝👆☝👆☝👆

    🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
    𝗧𝗛𝗜𝗦 𝗜𝗦𝗦𝗨𝗘 𝗜𝗦 𝗠𝗢𝗦𝗧𝗟𝗬 𝗦𝗢𝗟𝗩𝗘𝗗. 𝗟𝗢𝗢𝗞 𝗔𝗕𝗢𝗩𝗘 𝗬𝗔'𝗟𝗟 𝗕𝗘𝗙𝗢𝗥𝗘 𝗬𝗢𝗨 𝗣𝗢𝗦𝗧
    🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨

  19. locked as resolved and limited conversation to collaborators on Nov 25, 2018
  20. added
    workbench-workspace
    and removed
    workbench-editors
    on Jul 21, 2022
  21. added
    *out-of-scope
    on Dec 6, 2022
  22. vscodenpa commented on Dec 6, 2022

    @vscodenpa

    We closed this issue because we don't plan to address it in the foreseeable future. If you disagree and feel that this issue is crucial: we are happy to listen and to reconsider.

    If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

    Thanks for your understanding, and happy coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    *out-of-scopefeature-requestworkbench-workspace

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions