Repository navigation
Description
Does this issue occur when all extensions are disabled?: Yes/No
- VS Code Version:
- OS Version:
Steps to Reproduce:
Please don't allow el stupido (vscode-triage-bot) to close this!!!
I'm working at a fairly large MSFT site, so if you need upvotes, I'll get them!
Issue Type: Bug
I'm running Windows 11, and have multiple virtual desktops configured. On many of them, I have both VS Code and Google Chrome windows open. When I restart the computer, I exit out of both programs manually first (in VSC, via File -> Exit, and in Chrome, via the hamburger menu -> Exit). Exiting in this manner (instead of using the Close / X button in the top-right corner) closes all the windows of each program together, and allows the session to continue where it left off after reboot (VSC has the same Workspaces and tabs open, Chrome has the same windows and tabs open).
When I relaunch each of these programs, Chrome restores each window to the virtual desktop it had been on before the restart, whereas VSC restores all the workspaces/windows to the current desktop.
I'd love it if VSC could behave like Chrome, and restore each workspace/window to the virtual desktop it was on initially.
VS Code version: Code 1.63.0 (7db1a2b, 2021-12-07T06:26:56.179Z)
OS version: Windows_NT x64 10.0.22000
Restricted Mode: No
Fetching remote diagnostics for 'wsl+ubuntu' timed out.
Remote OS version: Linux x64 5.10.60.1-microsoft-standard-WSL2
System Info
Extensions (29)
A/B Experiments
Activity
vscodenpa commentedon Jun 22, 2022
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.68.1. Please try upgrading to the latest version and checking whether this issue remains.
Happy Coding!
dosinsk commentedon Jun 22, 2022
VS Code version: Code 1.68.0
OS version Windows_NT x64 10.0.22000
vscodenpa commentedon Jun 22, 2022
This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.
Happy Coding!
jayjadav08 commentedon Jun 22, 2022
+1
BenCrespoDuke commentedon Jun 22, 2022
+1
lordheart commentedon Jul 1, 2022
Edge also supports restore to windows correctly. Windows should make this easier.
My company has now reinstated auto shutdown every night so every morning it means placing all my open vs code projects back into their proper desktops.
DJackman123 commentedon Jul 9, 2022
Another aspect of virtual desktop support would be not having VSCode switch desktops when opening a file via command line. When I use "code" to open a file, it will open that file in the most recently used instance of VSCode, which will switch desktops if that instance was on a different desktop. I would prefer that it open the file in the most recently used instance only on the current desktop, ignoring other desktops. If VSCode isn't opened on the current desktop, then launch it there. In other words, don't ever have VSCode switch desktops.
vscodenpa commentedon Jul 15, 2022
🙂 This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.
Happy Coding!
DrCyanide commentedon Aug 23, 2022
This has definitely been the main reason I delay applying updates to Visual Studio Code as long as I possibly can. If the windows could just stay where I want them, then the only hassle would be logging back into the remote servers.
JodiTheTigger commentedon Nov 20, 2022
Just commenting so that people finding the old closed duplicate find this current one:
(closed duplicate) #88257
apparently this is waiting on an electron API update (6 years old: electron/electron#5362)
so if any coders want to get this moving - then implement a virtual desktop API for electron, then get vscode to pick it up.
Mugane commentedon Feb 1, 2024
Two years later... any update on this? Shall we expect it this decade or at least by 2040 perhaps?
JodiTheTigger commentedon Feb 2, 2024
Nope, no update. Electron still hasn't got a virtual desktop API. This affects lots of projects that use electron - not only vscode.
Things to follow to see the status:
brunnerh commentedon Aug 20, 2025
One more thing that ideally should be restored: Flags like "Show this window on all desktops" that can be set from the window context menu in the task view.
dimy-osman commentedon Aug 23, 2026
Still happening in 2026, including Cursor (VS Code fork) on Windows 11.
Same comparison as the original report: Brave / Chrome / Edge restore each window to the virtual desktop it was on. VS Code / Cursor restore every window onto the current desktop.
Chromium already persists the desktop GUID via
IVirtualDesktopManagerand moves the window back on restore. This does not need a new Windows API. Also chiming in on the latest duplicate: #319435