I am trying to open a tab in a new window in Visual Studio Code so I can move it to another screen. If I drag the tab the other screen, a file is created. Is there a shortcut to open a tab in a new Visual Studio Code window so I can move it to another screen?
To open a new tab in VS Code, all you need to do is double-click it instead of single-clicking it. This may seem a bit weird and confusing, but once you've gotten used to this function, you'll realize that it actually makes your job much easier.
If you are using Windows, just hit Ctrl + Shift + N. If you are on a Mac, just press Command + Shift + N.
You can switch between views using ctrl + 1 ( ⌘ + 1 ), ctrl + 2 ( ⌘ + 2 ), and so on. Alternatively, you can switch between tabs (and, by extension, between views) using ctrl + page up / page down ( ⌘ + page up / page down ).
On Windows and Linux, press CTRL+K, then release the keys and press O (the letter O, not Zero).
On macOS, press CMD+K, then O (without holding CMD).
This will open the active file tab in a new window/instance.
This is a very highly upvoted issue request in Github for Floating Windows.
Until they support it, you can try the following workarounds:
The Duplicate Workspace in new Window Command was added in v1.24 (May 2018) to sort of address this.
workbench.action.duplicateWorkspaceInNewWindow
to Ctrl + Shift + N or whatever you'd likeRather than manually open a new window and dragging the file, you can do it all with a single command.
As AllenBooTung also pointed out, you can open/drag any file in a separate blank instance.
VS Code will not allow you to open the same folder in two different instances, but you can use Workspaces to open the same directory of files in a side by side instance.
For any workaround, also consider setting setting up auto save so the documents are kept in sync by updating the files.autoSave
setting to afterDelay
, onFocusChange
, or onWindowChange
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With