Skip to content

Relaunching VSCode forgets what macOS Desktop each window belongs to #123517

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

Activity

  1. vscodebot commented on May 10, 2021

    @vscodebot

    (Experimental duplicate detection)
    Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

  2. lilyball commented on May 10, 2021

    @lilyball
    Author

    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.

  3. added
    electron
    on May 11, 2021
  4. bpasero commented on May 11, 2021

    @bpasero
    Contributor

    This needs support from Electron.

  5. added
    macos
    upstream-issue-pending
    workbench-window
    on May 11, 2021
  6. added
    feature-request
    and removed
    upstream-issue-pending
    on Dec 12, 2022
  7. vscodenpa commented on Dec 12, 2022

    @vscodenpa

    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!

  8. jd-solanki commented on Dec 13, 2022

    @jd-solanki

    It have 20 upvotes now 🥳

  9. vscodenpa commented on Dec 14, 2022

    @vscodenpa

    🙂 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!

  10. Felice-Enellen commented on Feb 27, 2023

    @Felice-Enellen

    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.

  11. Felice-Enellen commented on Feb 27, 2023

    @Felice-Enellen

    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".

  12. added
    upstream
    on Jun 2, 2023
  13. added a commit that references this issue on Apr 7, 2026
    210a7ec
  14. tnayuki commented on Apr 7, 2026

    @tnayuki

    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):

    • Save the AppKit restorable state as base64 in IWindowState.macOSRestorableState on quit
    • Restore it after BrowserWindow creation on startup

    Tested successfully on macOS 15 / Electron 39. Would a PR be welcome?

  15. jd-solanki commented on Apr 7, 2026

    @jd-solanki

    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 :)

  16. zeelux commented on Oct 21, 2026

    @zeelux

    Would love to see this fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

electronfeature-requestmacosupstreamworkbench-os-integrationworkbench-window

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions