You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
VS Code should restore windows to their original spaces when possible #979
*out-of-scopePosted issue is not in scope of VS CodeelectronIssues and items related to Electronfeature-requestRequest for new features or functionalityupstreamIssue identified as 'upstream' component related (exists outside of VS Code)workbench-windowWindow management
I have "window.reopenFolders": "all" set, and when I restart VS Code it correctly restores all the folders I had open. However, it restores them to the same OS X space, as opposed to the spaces they were originally in.
When VS Code is restarted it should try to restore the windows that were open to the spaces they were originally in.
Reacted by Ryan Boehning, Andrew Nicolaou, Gandalf Saxe, Ross Stenersen, Daze, Misha Vyrtsev, Ian Wambai, Kamil Hismatullin, Paul Garner, xgdgsc and 9 more
Logout of the current User. Log back into the same user.
Shut Down the computer. Turn the computer back on.
Restart the computer.
Expected Results:
Visual Studio Code's windows restore to the Spaces they were in when the action in Step 4 took place.
Actual Results:
Visual Studio Code restores all windows to the current Space (typically "Desktop 1") when the user is properly logged back in. They must be manually reassigned to the previous spaces.
Errata:
Compare Visual Studio Code's results with that of Apple's built-in applications: all windows of Apple-built apps correctly restore to the Space they existed in prior to the Sudden Termination event.
Apple does offer the ability to Assign apps to Spaces. However, this only adjusts what Space the Windows start in. If a user intentionally moves the windows to different Spaces then all Windows would recollect to that space upon restart instead of the previously assigned Space (as expected). In short, this is not a solution to the problem.
Use Case: A developer creates three Spaces and opens a folder in a unique Visual Studio Code window on each Space. These Spaces serve different development contexts for the developer. When restarting (say from OS update), the developer expects the windows to restore to the previously used Space.
Eric Robinson (@ericdrobinson) - I find that this problem exists even if I restart VS Code normally (i.e. not a sudden termination event). For example, when VS Code restarts to upgrade itself, I have to manually reassign all the windows I had open to their correct Space.
when VS Code restarts to upgrade itself, I have to manually reassign all the windows I had open to their correct Space.
This, unfortunately, is not something that is supported by macOS - it is a failing on Apple's side, not Visual Studio Code. It turns out that macOS only supports Spaces restoration on a reboot. You can test this yourself with Apple's built-in applications (e.g. Safari, Text Edit, Terminal, Quicktime, etc.). In simple application-restart scenarios, Apple's application windows do restore the previous visual state (as much as possible), but they do not properly restore previously used Spaces. [I, too, was surprised to find this to be the case when I specifically tested it...]
With respect to your initial comment:
Chrome, for example, does this correctly most some of the time.
This is 100% false. Current versions of Chrome will always restore to the default Space (typically Desktop 1) unless you've specifically assigned it to a Space through the Dock interface. This is a link to the Chromium Bug report that describes this issue for that application. This comment outlines the difference between simple "App Restart" and "System Reboot" in terms of what's supported.
The thread linked above has a lot of good information about this issue with respect to OS-integration and expectations. If you wish macOS would support Space reassignment on basic Application Restart, I'd suggest filing a bug report with Apple. The more of us that do so, the more likely they will be to enable it.
This is 100% false. Current versions of Chrome will always restore to the default Space (typically Desktop 1) unless you've specifically assigned it to a Space through the Dock interface.
I believe you are correct. I will remove that comment from my original post.
If you wish macOS would support Space reassignment on basic Application Restart, I'd suggest filing a bug report with Apple. The more of us that do so, the more likely they will be to enable it.
Is there no existing bug report we can just watch or add a +1 to? Otherwise, yes, I'll file a report assuming that's the appropriate thing to do.
This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.
Benjamin Pasero (@bpasero) Hilariously, the über-upstream issue (in Chromium) was actually fixed on September 30th. I've posted in the upstream issue with clarification on whether that fix will affect Electron or not. Fingers are crossed, but this may become feasible once Electron updates to a Chromium version that contains the fix...
This is something apps can implement (by saving window location on quit and restoring on start)
As such, the "upstream" issue wouldn't necessarily even be a blocker in the first place.
I dug into this a bit and I now suspect that there is indeed no way for apps to implement this feature without upstream work. As such I have issued a formal feature request in the Electron repository for support for this.
I will also move future comments to #123517. Thanks for the heads up!
*out-of-scopePosted issue is not in scope of VS CodeelectronIssues and items related to Electronfeature-requestRequest for new features or functionalityupstreamIssue identified as 'upstream' component related (exists outside of VS Code)workbench-windowWindow management
Activity
bpasero commentedon Dec 4, 2015
Have to check if there is API in Electron to find out about spaces.
bpasero commentedon Dec 12, 2016
From: #16991
Steps to Reproduce:
window.reopenFolderssetting set toall.Expected Results:
Visual Studio Code's windows restore to the Spaces they were in when the action in Step 4 took place.
Actual Results:
Visual Studio Code restores all windows to the current Space (typically "Desktop 1") when the user is properly logged back in. They must be manually reassigned to the previous spaces.
Errata:
Sudden Terminationevent.nchammas commentedon Dec 12, 2016
Eric Robinson (@ericdrobinson) - I find that this problem exists even if I restart VS Code normally (i.e. not a sudden termination event). For example, when VS Code restarts to upgrade itself, I have to manually reassign all the windows I had open to their correct Space.
ericdrobinson commentedon Dec 12, 2016
Nicholas Chammas (@nchammas):
This, unfortunately, is not something that is supported by macOS - it is a failing on Apple's side, not Visual Studio Code. It turns out that macOS only supports Spaces restoration on a reboot. You can test this yourself with Apple's built-in applications (e.g. Safari, Text Edit, Terminal, Quicktime, etc.). In simple application-restart scenarios, Apple's application windows do restore the previous visual state (as much as possible), but they do not properly restore previously used Spaces. [I, too, was surprised to find this to be the case when I specifically tested it...]
With respect to your initial comment:
This is 100% false. Current versions of Chrome will always restore to the default Space (typically Desktop 1) unless you've specifically assigned it to a Space through the Dock interface. This is a link to the Chromium Bug report that describes this issue for that application. This comment outlines the difference between simple "App Restart" and "System Reboot" in terms of what's supported.
The thread linked above has a lot of good information about this issue with respect to OS-integration and expectations. If you wish macOS would support Space reassignment on basic Application Restart, I'd suggest filing a bug report with Apple. The more of us that do so, the more likely they will be to enable it.
nchammas commentedon Dec 12, 2016
I believe you are correct. I will remove that comment from my original post.
Is there no existing bug report we can just watch or add a +1 to? Otherwise, yes, I'll file a report assuming that's the appropriate thing to do.
5 remaining items
bpasero commentedon Oct 10, 2019
The upstream issue has been closed as wontfix. That means, same here, sorry.
vscodebot commentedon Oct 10, 2019
This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.
If you wonder what we are up to, please see our roadmap and issue reporting guidelines.
Thanks for your understanding and happy coding!
ericdrobinson commentedon Oct 11, 2019
Benjamin Pasero (@bpasero) Hilariously, the über-upstream issue (in Chromium) was actually fixed on September 30th. I've posted in the upstream issue with clarification on whether that fix will affect Electron or not. Fingers are crossed, but this may become feasible once Electron updates to a Chromium version that contains the fix...
anentropic commentedon Mar 11, 2022
despite whatever issues there may be with the facilities provided by macos, iTerm and Sublime Text seem to manage to do this, as well as Chrome
gavofyork commentedon Mar 3, 2023
Then surely this should now be reopened.
ericdrobinson commentedon Mar 3, 2023
Gavin Wood (@gavofyork) What are you referring to?
Benjamin Pasero (@bpasero) Can you please consider reopening this issue? It seems awkward to allow #152869 to remain open while this one is closed.
What's more, while the "upstream" issue (electron/electron#10124) was closed, another Electron maintainer (Samuel Attard (@MarshallOfSound)) has suggested that this feature is something that apps (e.g. VS Code) can directly implement themselves:
As such, the "upstream" issue wouldn't necessarily even be a blocker in the first place.
bpasero commentedon Mar 4, 2023
We track this still at #123517
ericdrobinson commentedon Mar 4, 2023
I dug into this a bit and I now suspect that there is indeed no way for apps to implement this feature without upstream work. As such I have issued a formal feature request in the Electron repository for support for this.
I will also move future comments to #123517. Thanks for the heads up!