Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code: how to keep two projects open in tabs (instead of two windows)?

I have VS Code 1.15.1 and when I work at two projects at once, I choose File -> New Window and open the second project. Clicking File -> New Window opens new window with VS Code. On my other computer (not sure about the VS Code version there), when I click File -> New Window, instead of opening new window, it will rather open new tab, so that I end up with two tabs in one window, each tab for one project and the active tab occupies whole screen estate.

Any ideas what should I change in Settings to achieve this "single window, multiple tabs" layout when having multiple projects?

I use macos (not sure if OS may be somehow related to the window management settings)

like image 247
Peter Avatar asked Aug 28 '17 09:08

Peter


People also ask

How do you keep tabs open in VS Code?

Opening multiple tabs in VS Code is very straightforward. Double-click each entry from the Explorer list. However, to lock the tabs in place and prevent the single-click function from closing them, make sure that you double-click each one.

How do I split two windows in VS Code?

You can open as many editors as you like side by side vertically and horizontally. If you already have one editor open, there are multiple ways of opening another editor to the side of the existing one: Alt click on a file in the Explorer. Ctrl+\ to split the active editor into two.


2 Answers

This works in MacOS Mojave as well.

  1. Go to Preferences > Settings.
  2. Search for native tabs
  3. Check the checkbox
Native tabs checkbox
  1. Code will prompt for restart to take effect.
Dialog box prompt for restart
  1. After restart, make sure you have multiple projects open. And then merge all windows as shown below:
Merge all windows
  1. Enjoy multiple tabs in single window.

Note: I think this applies to all Mac OS >= Sierra. Tested with Catalina recently.

like image 75
Tenzin Chemi Avatar answered Sep 19 '22 15:09

Tenzin Chemi


Just set in your user settings "window.nativeTabs": true and do Window -> Merge All Windows

note: If you have High Sierra installed, that might be an issue.

Here's the link: Better macOS native window tabs support

like image 40
Alex Brazh Avatar answered Sep 19 '22 15:09

Alex Brazh