Steps to Reproduce:
Related: When working with multiple workspaces, clicking on VS Code in the taskbar on a workspace where it hasn't been started yet switches to a running instance on another workspace instead of starting a new one.
This has to be fixed, very annoying now that Windows finally has multiple virtual desktops natively.
VS Code should automatically open a new window upon execution. This way, Windows will take care of activating an existing window unless shift is held while clicking the button, or, opening a new VS Code window.
It may actually be a problem with electron apps in general. Postman also exhibits this behavior.
I think it should be done by setting System.AppUserModel.RelaunchCommand with -n argument.
It will need to be implemented in Electron (like e.g. jump lists).
'New Window' works, but middle click and Shift + left click still don't.
I've just finished some investigation into this. It works when launch VSCode using scripts\code.bat, but not when I build VSCodeSetup.exe and install it.
The shortcut in start menu (which has the same AppUserModelID as the window) seems to take priority over the RelaunchCommand value. (I couldn't find any way to override this.)
AppUserModelID of the shortcut and the window needs to match so they share one MFU list and jump list.
Only solution I can think of is to add the -n argument to the start menu shortcut too.
I am a bit confused, I could swear I tested this. But probably only from a local built VS Code, never when going through the setup. Too bad...
Had similar issue with sublime, managed to get it working by adding the -noframemerging switch to the target of the shortcut. Right click on shortcut to vscode, go to shortcut tab and in target add -noframemerging after the path to the executable (should be outside the quotes).
How is this still a thing?
@the-ress I cannot really explain it but with our current insiders release, middle-click on the taskbar opens a new window for me (stable does not work).
Can others try to reproduce this with our insiders: https://code.visualstudio.com/insiders/
I am very confused what change could have an impact :-/
Wow, now I am back to having it NOT working in insiders, this is very weird....
Most helpful comment
Had similar issue with sublime, managed to get it working by adding the -noframemerging switch to the target of the shortcut. Right click on shortcut to vscode, go to shortcut tab and in target add -noframemerging after the path to the executable (should be outside the quotes).