vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Support to open a project folder in multiple VS Code windows

Open weinand opened this issue 10 years ago • 122 comments

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).

@bpasero @dbaeumer @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 https://github.com/Microsoft/vscode/issues/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.

weinand avatar Feb 03 '16 22:02 weinand

I think this is a duplicate of https://github.com/Microsoft/vscode/issues/48

Tyriar avatar Feb 03 '16 22:02 Tyriar

@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.

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

weinand avatar Feb 03 '16 23:02 weinand

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.

@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.

bpasero avatar Feb 04 '16 06:02 bpasero

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

stereokai avatar May 10 '16 13:05 stereokai

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.

bpasero avatar May 10 '16 13:05 bpasero

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

stereokai avatar May 13 '16 12:05 stereokai

I found a workaround - use ln -s.

hackwaly avatar Jun 24 '16 09:06 hackwaly

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?

bpasero avatar Oct 13 '16 12:10 bpasero

Additional notes

  • impact on language server which we will start twice on the same workspace

dbaeumer avatar Oct 14 '16 12:10 dbaeumer

Additional notes:

  • The hot exit implementation currently assumes a folder will only ever be opened once, it would need to be tweaked to allow 'duplicate' workspaces

Tyriar avatar Oct 17 '16 15:10 Tyriar

FYI: the debug team is currently working on a solution for "multi target debugging" that does not require to open a project folder in multiple VS Code windows. So we are not relying on this feature request.

weinand avatar Oct 17 '16 19:10 weinand

Any chance of implementation of the feature 'opening multiple instance's of the same project' in the near (3-6 month) future? VSCode is great, I enjoy using it daily but lack of multiple instances pains me when I must open another editor to view multiple project files side by side. Split editor is great and all.. but anymore than two isn't very efficient.

If not I understand that this truly is the definition of 'First World Problem'...

Cellery72 avatar Nov 16 '16 02:11 Cellery72

+1

rafaelabreu avatar Nov 30 '16 22:11 rafaelabreu

I very need this feauture too!

maxbaluev avatar Dec 02 '16 07:12 maxbaluev

Guys guys guys, sometimes putting stuff in one window just isn't enough, please provide a way of doing so :/

markpradhan avatar Dec 21 '16 14:12 markpradhan

It would be nice if it worked like Visual Studio where you could drag a tab to another monitor. It wouldn't have to support having two separate VS Code instances running for the same folder. Just being able to move the tabs outside of the current VS Code window would be the most useful.

derekmt12 avatar Dec 21 '16 15:12 derekmt12

I understand that multiple windows will provoke many technical problems but there is a middle ground that I believe is a safer and more feasible approach, an idea taken from other IDEs.

What other IDEs (like IntelliJ) do is to have a Master Window, which is capable of displaying everything that a master window should: Debugger, tools on the left, the folder structure, etc. But each file can be open in a separate "child" window, which is not an actual window per se, it's just a floating UI "imitation". It only allows to display and edit the file contents (along with intellisense), nothing more, no other tools are displayed. I know it's not a normal window because the user can't use it in Split Screen (OS X feature) for example.

Would this be a better option if the full solution is not technically feasible?

csotiriou avatar Dec 30 '16 17:12 csotiriou

@csotiriou proposes a nice solution which would make what @derekmt12 talks about possible. Being a multi-monitor user myself, I've resorted to resizing the vscode window to stretch across both screens. And then resize the editor group so its near the middle point so each EditorGroup has its own screen. It's quite frustrating. All you would need to render in a separate window would be another EditorGroup.

rozzzly avatar Jan 02 '17 21:01 rozzzly

I think what people really want is to open a single instance of VSCode, but allow undocking of the tabs so that you can move the tabs to other windows...much like you can in Visual Studio 2015.

calloncampbell avatar Jan 25 '17 18:01 calloncampbell

@calloncampbell yes that may make more sense, introducing a "child window" concept that lacks some functionality of the "main window" as has been mentioned previously. That would definitely make this a lot easier to implement as all these workspace-specific features (git, hot exit) would still only need to care about a single workspace.

Tyriar avatar Jan 25 '17 19:01 Tyriar