deadcoder0904
deadcoder0904

Reputation: 8693

How to open another folder in VSCode in the same instance?

Let's say I have 2 folders - apple & orange

Now I opened apple in VSCode using code apple.

In the embedded terminal in VSCode, how do I open orange folder in the same instance as apple by overriding it without starting a new instance?

Upvotes: 15

Views: 5843

Answers (2)

r-uu
r-uu

Reputation: 637

@rioV8 suggested this solution: File > Add Folder to Workspace ==> Multi Root Workspace

Upvotes: 1

Avinash Singh
Avinash Singh

Reputation: 5392

Support for multi-root workspaces is there.vscode-insiders which support multiple projects at same time.Please refer to our documentation for a full explanation of all the features that come with it. Extension authors should refer to our wiki that explains the new extension APIs to make your extension ready for multi-root workspaces.

You can do it like this:

I just tried in my system it working perfectly fine to open a another folder in same instance

code -r path

Like: code -r C:\Users\admin\xxxx\xxxx\apple(orange already opened in the same instance)

If you want to open a existing folder in new window from terminal:

code -n Path

Like: code -n C:\Users\admin\xxxx\xxxx\apple(apple will opens in another window and orange also there.)

If you want to open a new tab in same instance by terminal:

code filename.extension (Hit enter then just press ctrl+S and then it saved the file in the same directory).

Thanks for the question.Hope this will match your curiosity B|

Upvotes: 9

Related Questions