15

(Using MacOS Mojave, VSCode 1.28.2)

I'm using VSCode in text editing(like .js, .txt, .csv,...).

When I double click and open a file in Finder or Desktop(or "Open in VSCode"), and if I'm opening another workspace, it opens the file in the same window as the workspace I'm already opening.

How to make VSCode to always open files in a new window?

example

2 Answers 2

27

Set "window.openFilesInNewWindow": "on" in settings.json.

Click on the gear icon on the bottom-left corner of the window, select Settings then enter window.openFilesInNewWindow in the search box that appears on the top of the Settings tab to find the setting quickly. Click on it and select "on" from the dropdown list.

It explains (below or above the setting, depending if you use the new Settings manager or edit the settings.json file):

Files will open in a new window.

1
  • 3
    I was seeking: "window.openFoldersInNewWindow": "on" behviour. Sep 20, 2019 at 13:25
2

You can try opening the following:

Open the Command pallet using Ctrl+Shift+p
Open user settings(which is a JSON)
Add a new property
"workbench.editor.enablePreview": false

and save it

1
  • 1
    That's an entirely different setting from what was asked. enablePreview is for not opening a file in the workspace as a preview — which could potentially overwrite the current editor window. Dec 5, 2019 at 17:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.