81

Instead of splitting windows, is it possible to drag the tabs to a new window in Visual Studio Code like Sublime, PHPstorm or Chrome?

When I drag a tab onto the desktop, it will copy the file.

2
  • 7
    Why the heck does simply dragging a tab out of VSCode not work? I was shocked when I tried doing that and it made a copy of the file I dragged out to my desktop lol. There has got to be a extension that makes dragging a tab out of VSCode, open that file in a new instance of VSCode. That is how Sublime Text works be default and every other program I have ever used... Commented Apr 24, 2021 at 13:26
  • this is WinDoze Commented Apr 27, 2023 at 20:11

3 Answers 3

92

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 [1]

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

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

Duplicate Workspace in New Window

2. Open Active File in New Window [2]

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 Ctrl + K, O

Open Active File in New Window

3. New Window with Same File [3]

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

  1. Open New Window Ctrl + Shift + N
  2. Drag tab into new window

4. Open Workspace and Folder Simultaneously [4]

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 Ctrl + K,Ctrl + O
  2. Save Current Project As a Workspace
  3. Open Folder Ctrl + K,Ctrl + O

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

4
  • 2
    the issue on github is open since 2016, and they closed it in 2018 saying that it's on the team's radar... lol, rip.
    – Jose V
    Commented Jan 8, 2020 at 20:19
  • 2
    It actually looks like the issue is still 'open', but just 'locked' for further comments. That's probably pretty reasonable for an issue with 3k+ reactions already, as it's not likely to invite more helpful feedback and seems like it's on the team's radar.
    – KyleMit
    Commented Jan 8, 2020 at 22:33
  • I'm very happy with the Ctrl-k,o solution. VS Code is a breakthrough product for me. After 40 years in the business I have finally found an improvement on notepad++. so I'm happy to let them set their own priorities. Commented Apr 11, 2023 at 1:03
  • none of this solutions work if you are connected to a dev container (using Remote Development extension) Commented Jul 14, 2023 at 7:28
37

■New Window with Same File

  1. Press CTRL+SHIFT+N to create a default new window.

  2. Drag the tab into this new window.

■Command Line

  1. Add C:\Users\Allen\AppData\Local\Programs\Microsoft VS Code to system path.

  2. Type this command in terminal.

PS D:\xampp\htdocs\bi>code vendor/bin/../composer/autoload_files.php -n

■AutoHotKey

  1. Compile this ahk script and execute it.

 

+!v::
clipboardstr := Clipboard
run, code %clipboardstr% -n
return
  1. Right click on the tab and then press shift+ alt+ c in vscode can copy file path to clipboard.

  2. shift+ alt+ v open this page to new window.

4
  • 3
    Simplest solution. Commented Jun 5, 2019 at 12:03
  • 3
    not that simple, way more keystrokes and clicks, and inferior. is there a way to customize the behavior such that we can simply drag to create a new window like sublimetext allows?
    – ahnbizcad
    Commented Oct 3, 2019 at 23:05
  • Doesn't work with all tabs, especially git comparison tabs. Commented Jul 13, 2021 at 4:50
  • Doesn't currently work with Remote SSH sessions, ergo codespaces.
    – cswilby
    Commented Aug 25, 2021 at 0:53
3

This has been added in the newest update (1.85.x)

Just drag the tab into another screen (or outside vs code) it will open in as a new window

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .