You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support to open a project folder in multiple VS Code windows #2686
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).
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.
Reacted by Ivan Buhov, Allen, Nguyễn Văn Cao Nguyên, Tom Alon, David Barreto, Sean G. Wright, Lee JeongHo, kidme Ouedraogo, Merwan Rodriguez, Altay and 614 more
Reacted by Florian Castellane, Yupei Liu, Daniel Martin, salexkidd, dxo , Clinton Bush, bstro, danikkks, Nikolche Kolev, David and 42 more
Reacted by Florian Castellane, salexkidd, dxo , Clinton Bush, bstro, Michael Kriese, danikkks, Nikolche Kolev, Art Pai, David and 60 more
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.
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.
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.
Reacted by Benjamin Kane, Mathieu Savy, Aaron Goldsmith, Lez and Salvatore Giammanco
Reacted by Marvin Altemeier and Christian Grandsjö
Reacted by Cole Lawrence, Norman, zhnd, qaisjp, Marvin Altemeier, Tim Rudnevsky, Richard Leap, Dan Kapellusch, David Warburton, Tomáš Hromada and 5 more
Reacted by noname, Rory, Chiri Vulpes, V4V, György Kiss, Robby Emmert, Nazim Jamil-Mir, Mark Carpenter Jr, zhnd, Jahan Addison and 14 more
@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.
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.
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
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.
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.
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.
Activity
Tyriar commentedon Feb 3, 2016
I think this is a duplicate of #48
weinand commentedon Feb 3, 2016
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,
bpasero commentedon Feb 4, 2016
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.
stereokai commentedon May 10, 2016
Benjamin Pasero (@bpasero) How about this? Is this a feature that a contributor can solve or only core team members?
bpasero commentedon May 10, 2016
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.
stereokai commentedon May 13, 2016
Benjamin Pasero (@bpasero) I understand. Well then, hope this feature comes out soon, would contribute a lot to users with multi-monitor setups
hackwaly commentedon Jun 24, 2016
I found a workaround - use
ln -s.bpasero commentedon Oct 13, 2016
Some notes:
111 remaining items
jcklpe commentedon Aug 27, 2018
Nowaker commentedon Aug 30, 2018
@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.chriskuech commentedon Oct 25, 2018
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 runningcode .. This would open the folder/workspace, as opposed tocode .\myFile.extopening the single file without the context of a workspace. VS Code now seems to infer the workspace from the file, socode .\myFile.extandcode .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.FernandoMiguel commentedon Oct 25, 2018
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
chriskuech commentedon Oct 25, 2018
Thanks Fernando Miguel (@FernandoMiguel) , it seems
code -n .\myFile.extsuccessfully opens a new window containingmyFile.ext, even when an existing workspace is open.ConnectivityChris commentedon Nov 14, 2018
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)
bpasero commentedon Nov 24, 2018
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?
jcklpe commentedon Nov 24, 2018
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:
👆☝👆☝👆☝👆
🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
𝗧𝗛𝗜𝗦 𝗜𝗦𝗦𝗨𝗘 𝗜𝗦 𝗠𝗢𝗦𝗧𝗟𝗬 𝗦𝗢𝗟𝗩𝗘𝗗. 𝗟𝗢𝗢𝗞 𝗔𝗕𝗢𝗩𝗘 𝗬𝗔'𝗟𝗟 𝗕𝗘𝗙𝗢𝗥𝗘 𝗬𝗢𝗨 𝗣𝗢𝗦𝗧
🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
vscodenpa commentedon Dec 6, 2022
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!