Can I, when opening a folder in VSC, choose whether I replace the current window or open the folder in a new window?

Viewed 151
  1. Within Visual Studio Code (VSC) I'd like to choose, on the spot, whether the folder I open replaces the current window or opens the new window. I already know this exists:
  • The `--new-window --reuse-window` CLI tags.
  • A `window.openFoldersInNewWindow` setting.
  • The option to do File>New Window & open it from there.

What I'm looking for is the ability to choose, on the spot, from the VSC app e.g. open folder...


  1. Perhaps a solution to my problem could be found by easily toggling workspace folders. What if by clicking on a folderB, all the tabs of folderA close. Is something like this possible?
1 Answers

You can install the Open Folder Context Menus for VS Code extension to have two more context menus to your explorer:

  1. Open New Workbench Here
  2. Reopen Workbench Here

This can probably gives you the option you're looking for "on the spot".

But my suggested way you can also take is to use the terminal to do this e.g. code yourDesiredFolderPath -r to force opening a file or folder in an already opened window, or code yourDesiredFolderPath -n to force opening it in a new window. (See the other options by code -h in your terminal)

Related