Repository navigation
Open
Labels
electronIssues and items related to Electronfeature-requestRequest for new features or functionalitymacosIssues with VS Code on MAC/OS XupstreamIssue identified as 'upstream' component related (exists outside of VS Code)workbench-os-integrationNative OS integration issuesworkbench-windowWindow management
Milestone
Description
Issue Type: Bug
For native macOS apps, if I have windows spread across multiple Mission Control Desktops, quitting and relaunching the app restores the windows to the appropriate desktop. VSCode does not do this. Instead it displays all restored windows on the current desktop. This is very annoying since I'm using desktops to manage different workspaces (e.g. one project per desktop, with all associated files and windows), so every time I have to relaunch VSCode I have to manually drag each window back to the appropriate desktop.
VS Code version: Code 1.56.0 (Universal) (cfa2e21, 2021-05-04T22:06:21.189Z)
OS version: Darwin x64 20.3.0
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz (8 x 2700) |
| GPU Status | 2d_canvas: enabled gpu_compositing: enabled metal: disabled_off multiple_raster_threads: enabled_on oop_rasterization: enabled opengl: enabled_on rasterization: enabled skia_renderer: disabled_off_ok video_decode: enabled webgl: enabled webgl2: enabled |
| Load (avg) | 35, 10, 6 |
| Memory (System) | 16.00GB (0.18GB free) |
| Process Argv | --crash-reporter-id 9e084c31-c5e0-4ce9-9608-5534964bf050 |
| Screen Reader | no |
| VM | 0% |
Extensions (52)
| Extension | Author (truncated) | Version |
|---|---|---|
| vscode-sievehighlight | adz | 1.0.2 |
| vscode-icalendar | af4 | 1.0.1 |
| Bookmarks | ale | 13.0.4 |
| project-manager | ale | 12.1.0 |
| ascii-tree-generator | apr | 1.2.4 |
| troff | ban | 1.0.22 |
| Nix | bbe | 1.0.1 |
| vagrant | bbe | 0.5.0 |
| vscode-fish | bma | 1.0.21 |
| better-toml | bun | 0.3.2 |
| vscode-modelines | chr | 2.0.5 |
| bracket-select | chu | 2.0.2 |
| bracket-pair-colorizer-2 | Coe | 0.2.0 |
| viml | dun | 0.1.7 |
| gitlens | eam | 11.4.1 |
| EditorConfig | Edi | 0.16.4 |
| tslint | eg2 | 1.0.46 |
| vscode-todo-plus | fab | 4.18.3 |
| lex-flex-yacc-bison | fau | 0.0.3 |
| vscode-pull-request-github | Git | 0.26.0 |
| vscode-graphql | Gra | 0.3.16 |
| beautify | Hoo | 1.5.0 |
| jenkinsfile-support | ivo | 1.1.0 |
| language-haskell | jus | 3.4.0 |
| swift | Kas | 0.2.0 |
| nim | kos | 0.6.6 |
| vscode-fix-checksums | leh | 1.1.0 |
| colonize | lil | 0.0.1 |
| autoconf | mae | 0.1.0 |
| gluon | Mar | 0.3.0 |
| rust-analyzer | mat | 0.2.591 |
| vscode-elixir | mjm | 1.1.0 |
| python | ms- | 2021.5.829140558 |
| vscode-pylance | ms- | 2021.5.1 |
| jupyter | ms- | 2021.6.811652604 |
| remote-ssh | ms- | 0.65.4 |
| remote-ssh-edit | ms- | 0.65.4 |
| cpptools | ms- | 1.3.1 |
| vscode-ios-common-files | Ort | 1.0.5 |
| synthwave-vscode | Rob | 0.1.8 |
| llvm | RRe | 0.1.1 |
| perl6-lsp | scr | 0.3.0 |
| code-settings-sync | Sha | 3.4.3 |
| tcl | sle | 0.2.0 |
| ascii-plist | spe | 1.0.3 |
| rewrap | stk | 1.14.0 |
| shellcheck | tim | 0.14.1 |
| jest-snapshot-language-support | tle | 1.1.1 |
| cmake | twx | 0.0.17 |
| vscode-terminal-here | Tyr | 0.2.4 |
| tmlanguage | Tog | 0.9.1 |
| FilterText | yhi | 0.0.15 |
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspyt653:30270858
pythonvspyt602:30300191
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyt639:30300192
pythontb:30283811
vspre833cf:30267465
pythonptprofiler:30281270
vshan820:30294714
vscorecescf:30290706
pythondataviewer:30285071
vscus158:30286553
Reacted by Jarrod Davis, Denis Loginov, Nathaniel Palmer, Jason Unsworth, Lemmingh, Brian Scholer, Naftali Beder, jvavrek, xgdgsc, JD Solanki and 66 more
Metadata
Metadata
Assignees
Labels
electronIssues and items related to Electronfeature-requestRequest for new features or functionalitymacosIssues with VS Code on MAC/OS XupstreamIssue identified as 'upstream' component related (exists outside of VS Code)workbench-os-integrationNative OS integration issuesworkbench-windowWindow management
Activity
vscodebot commentedon May 10, 2021
(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:
lilyball commentedon May 10, 2021
I don't believe this is covered by #116358. Beyond the fact that that issues is for Windows and this is for macOS, that issue was also considered a feature, whereas I firmly believe the macOS issue is a bug, as restoring to the correct desktop is a standard platform convention when restoring app windows.
bpasero commentedon May 11, 2021
This needs support from Electron.
vscodenpa commentedon Dec 12, 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!
jd-solanki commentedon Dec 13, 2022
It have 20 upvotes now 🥳
vscodenpa commentedon Dec 14, 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!
Felice-Enellen commentedon Feb 27, 2023
The same problem exists on Windows, along with windows not remembering being minimized. Should that be a separate issue or can it be rolled into this one? It seems like this might be a multi-platform issue, not constrained to Apple systems.
Felice-Enellen commentedon Feb 27, 2023
In fact, I'd say the issue should really be something a bit more comprehensive, like "windows need to remember as much desktop manager state as is available on each OS as possible".
feat: restore windows to their original macOS Spaces on restart
tnayuki commentedon Apr 7, 2026
Dealing with this daily — manually dragging windows back to their Spaces after every restart is really frustrating.
Built a fix using AppKit's native state restoration APIs (
NSWindow.encodeRestorableStateWithCoder:/restoreStateWithCoder:), packaged as electron-osx-spaces. This approach doesn't require any changes to Electron itself.The integration into VS Code is minimal (65 lines across 3 files):
IWindowState.macOSRestorableStateon quitBrowserWindowcreation on startupTested successfully on macOS 15 / Electron 39. Would a PR be welcome?
jd-solanki commentedon Apr 7, 2026
Toru Nayuki (@tnayuki) please drop a PR if possible, I'm waiting for so long. I hope they atleast they handle it in new sessions app 🤔
thanks :)
zeelux commentedon Oct 21, 2026
Would love to see this fixed.
feat(macos): proof of concept for native spaces restoration via NSWin…
feat(macos): proof of concept for native spaces restoration via NSWin…