Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save electron-main state periodically to prevent loss on shutdown or reboot #87171

Closed
umdstu opened this issue Dec 17, 2019 · 6 comments
Closed
Assignees
Labels
feature-request Request for new features or functionality on-testplan workbench-state UI state across restarts
Milestone

Comments

@umdstu
Copy link

umdstu commented Dec 17, 2019

Existing Issue (Locked): #207

  • VSCode Versions: ~1.25 to 1.40
  • OS Version: WIndows 10

Steps to Reproduce:

  1. Open Vscode
  2. Open (and Select) a Folder
  3. New Window
  4. Open (and Select) another Folder
    ~~ You now have two Windows / Folders open ~~
  5. Log out of Windows
  6. Log back into Windows
  7. Launch VSCode
    ~~ Only one of the two Windows from before will open.~~

My understanding was that #207 was suppose to add/fix this. It's also a bit confusing as there have been multiple configuration settings discussed, to include:

{
  "window.reopenFolders": "all",
  "window.reopenWindows": "all",
  "window.restoreWindows": "all" ## Control how windows are being reopened after a restart
}

However, only the latter is identified as an known configuration setting. Does "window.restoreWindows" not apply to Windows > Signout ? Is there a different setting that does?

Does this issue occur when all extensions are disabled?: Yes/No

@umdstu
Copy link
Author

umdstu commented Dec 17, 2019

@bpasero At your convenience, please take a look as this one is (possibly) linked to a previous issue of yours, Thanks.

@bpasero
Copy link
Member

bpasero commented Dec 17, 2019

@umdstu are you logging out of windows while VSCode is running? this will terminate the process and leave us no normal shutdown sequence. In order to restore window state, we currently require a clean shutdown.

@bpasero bpasero self-assigned this Dec 17, 2019
@bpasero bpasero added info-needed Issue requires more information from poster workbench-state UI state across restarts labels Dec 17, 2019
@umdstu
Copy link
Author

umdstu commented Dec 17, 2019

Ah yes, I absolutely am logging out while VSCode is running.

How does that work though if I have to close each of the windows manually, then there would be no 'state' to return to once logged back in, right? I will have to test but I think it would just open the last window you closed.

The problem with manually closing windows is that it forces you to save untitled/unsaved tabs/files (Scratch pads for me); maybe i'm missing a setting though. This works well when you don't manually close the windows.

Would #12058 make this any better?

@bpasero
Copy link
Member

bpasero commented Dec 17, 2019

@umdstu you don't have to close windows one by one, simply pick File > Exit and you are all set.

Yes #12058 is relevant, though this particular state is not persisted in the same way. It would need another fix. I will rename this issue to reflect that.

@bpasero bpasero changed the title Remember all UI state even when reopening window without workspace (#207) Save electron-main state periodically to prevent loss on shutdown or reboot Dec 17, 2019
@bpasero bpasero added feature-request Request for new features or functionality and removed info-needed Issue requires more information from poster labels Dec 17, 2019
@bpasero bpasero added this to the Backlog milestone Dec 17, 2019
@bpasero bpasero removed their assignment Dec 17, 2019
@umdstu
Copy link
Author

umdstu commented Dec 17, 2019

Ok thanks for the info on Exiting all at once, and thanks for updating the issue to reflect the actual situation here!

@bpasero bpasero self-assigned this Dec 18, 2019
@bpasero
Copy link
Member

bpasero commented Dec 18, 2019

I pushed a change to save the window state also when any window looses focus (e.g. when reaching to the Windows signout button it should persist). I hope this strategy resolves the issue properly, maybe you could verify in tomorrows insider build.

@bpasero bpasero added verification-needed Verification of issue is requested on-testplan and removed verification-needed Verification of issue is requested labels Jan 24, 2020
@vscodebot vscodebot bot locked and limited conversation to collaborators Feb 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality on-testplan workbench-state UI state across restarts
Projects
None yet
Development

No branches or pull requests

2 participants