简体   繁体   中英

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

  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 eg 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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM