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?

This is a very highly upvoted issue request in Github for Floating Windows.

Until they support it, you can try the following workarounds:

1. Duplicate Workspace in New Window <sup>[1]</sup>

The Duplicate Workspace in new Window Command was added in v1.24 (May 2018) to sort of address this.

  1. Open up Keyboard Shortcuts <kbd>Ctrl</kbd> + <kbd>K</kbd>, <kbd>Ctrl</kbd> + <kbd>S</kbd>
  2. Map workbench.action.duplicateWorkspaceInNewWindow to <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>N</kbd> or whatever you'd like

Duplicate Workspace in New Window

2. Open Active File in New Window <sup>[2]</sup>

Rather than manually open a new window and dragging the file, you can do it all with a single command.

  1. Open Active File in New Window <kbd>Ctrl</kbd> + <kbd>K</kbd>, <kbd>O</kbd>

Open Active File in New Window

3. New Window with Same File <sup>[3]</sup>

As AllenBooTung also pointed out, you can open/drag any file in a separate blank instance.

  1. Open New Window <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>N</kbd>
  2. Drag tab into new window

4. Open Workspace and Folder Simultaneously <sup>[4]</sup>

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.

  1. Open Folder <kbd>Ctrl</kbd> + <kbd>K</kbd>,<kbd>Ctrl</kbd> + <kbd>O</kbd>
  2. Save Current Project As a Workspace
  3. Open Folder <kbd>Ctrl</kbd> + <kbd>K</kbd>,<kbd>Ctrl</kbd> + <kbd>O</kbd>

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

AutoSave