VS Code New Window: How to Open and Use It
In this article
To open a new window in VS Code, press Ctrl+Shift+N (Windows/Linux) or Cmd+Shift+N (macOS). This creates a fresh, empty editor window separate from your current one, letting you work on multiple projects or folders side by side.
What Is a New Window in VS Code?
A new window in VS Code is a separate instance of the editor. Each window can have its own set of open files, folders, and even different workspaces. This is different from opening a new tab within the same window, which just adds another file to the existing editor. New windows are useful when you need to compare code across projects, keep a scratch pad open, or isolate a different workspace without closing your current work.
How to Open a New Window
There are several ways to open a new window in VS Code, depending on what you need:
- Keyboard shortcut:
Ctrl+Shift+N(Windows/Linux) orCmd+Shift+N(macOS) opens a new empty window. - Menu: Go to File > New Window.
- Command Palette: Press
Ctrl+Shift+P(orCmd+Shift+P), type “New Window,” and select the command. - From the current window: Use File > New Window while a folder is open; the new window will be empty unless you choose to duplicate the current one.
What You Can Do With Multiple Windows
Multiple windows are more than just a convenience. They let you:
- Work on two different projects at the same time, each with its own file explorer and settings.
- Compare files side by side across different folders without switching back and forth.
- Keep a reference window open with documentation or a log file while you edit code in another.
- Use a separate window for a different workspace (e.g., a personal project vs. a work project) to keep settings and extensions isolated.
How to Open a Folder in a New Window
Often you want a new window with a specific folder already loaded. Here’s how:
- In the current window, go to File > Open Folder (or Open on macOS).
- In the file dialog, select the folder you want.
- Click the Open button, but before it opens, look for a dropdown arrow next to the button (on some systems) or hold
Ctrl(Windows/Linux) orCmd(macOS) while clicking. This forces VS Code to open the folder in a new window instead of replacing the current one. - Alternatively, you can use the command palette and search for “Open Folder in New Window.”
Common Problems and Fixes
Sometimes the shortcut doesn’t work or a new window doesn’t appear. Here are a few things to check:
- Shortcut not working: Another extension or application might have taken over the shortcut. Check your keybindings by opening the Command Palette and searching “Preferences: Open Keyboard Shortcuts.” You can also reset the shortcut to its default.
- New window opens but is blank: That’s normal if you didn’t specify a folder. You need to open a folder or file in the new window to see content.
- Clicking “Open Folder” replaces the current window: This happens when you don’t hold the modifier key. Use
CtrlorCmdwhen clicking the Open button, or use the dedicated command. - Multiple windows cause high memory usage: Each window is a separate process, so memory usage can add up. Close windows you’re not using.
New Window vs. New Tab
It’s easy to confuse these two. A new tab adds a file to the current window’s tab bar. A new window creates a completely separate editor instance. The main difference is that tabs share the same workspace, settings, and extensions, while windows can have entirely different workspaces. If you only need to look at another file in the same project, use a tab. If you need to work on a different project or compare two projects, use a new window.
Frequently Asked Questions
How do I open a new window in VS Code on a Mac?
Press Cmd+Shift+N or go to File > New Window. The menu and shortcut work the same way as on Windows, just with the Cmd key instead of Ctrl.
Why does VS Code open a new window when I click a file from Explorer?
This usually happens if you have the setting workbench.editor.enablePreview disabled or if the file is being opened from an external file manager. You can change the behavior by going to File > Preferences > Settings and searching for “open in new window.” Look for the setting that controls how files open from outside VS Code.
Can I open the same folder in two windows?
Yes, you can. Open the folder in one window, then go to File > New Window and open the same folder again. VS Code will allow it, but note that changes in one window will be reflected in the other because they share the same files on disk.
How do I close a new window?
Click the X on the window’s title bar, or press Ctrl+Shift+W (Windows/Linux) or Cmd+Shift+W (macOS) to close the entire window. If you have unsaved changes, VS Code will prompt you to save them.
Is there a way to make VS Code always open in a new window?
Yes. Go to File > Preferences > Settings and search for “window.openFoldersInNewWindow.” Set it to “on” to always open folders in a new window. There’s also a similar setting for files: “window.openFilesInNewWindow.”
What’s the difference between “New Window” and “Duplicate Workspace”?
“New Window” opens a blank editor with no workspace. “Duplicate Workspace” (available via File > Duplicate Workspace) opens a new window with the same folders and files as the current one, but as a separate instance. This is useful when you want to work on the same project in two windows without re-opening the folder manually.