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

Last active window is not always restored when reopening #20770

Closed
michaeljonathanblack opened this issue Feb 16, 2017 · 6 comments
Closed

Last active window is not always restored when reopening #20770

michaeljonathanblack opened this issue Feb 16, 2017 · 6 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@michaeljonathanblack
Copy link

Instead, the last VS Code window to be closed (typically the most-background window) is opened.

This behavior does not mimic the "Reload" behavior that newly installed extensions offer, which works as expected.

Apologies if this is a duplicate.

@bpasero
Copy link
Member

bpasero commented Feb 19, 2017

Try: "window.reopenFolders": "all"

@bpasero bpasero closed this as completed Feb 19, 2017
@michaeljonathanblack
Copy link
Author

@bpasero I see the problem! There's a bug in the default behavior.

// Controls how folders are being reopened after a restart. 
// Select 'none' to never reopen a folder, 'one' to reopen the last folder you worked on or 'all' to reopen all folders of your last session.

The "last folder you worked on" is not always accurate as VS Code sometimes closes the folders out of order from when they were last worked on.

I assume closing "front to back" is intended, but sometimes background tasks/terminals/editors/etc. cause the front-most, last-worked-on window to close later than another window.

To reproduce:

  1. Clone react-slingshot
  2. Clone redux-auth
  3. Open both projects in their own windows
  4. Install and Start react-slingshot via VS Code Terminal
  5. Open up numerous editors in the react-slingshot window
  6. cmd + q VS Code
  7. Relaunch VS Code

These repro steps are intermittent, but they can provide the behavior, e.g.

I can open up another issue if that is more appropriate.

@bpasero
Copy link
Member

bpasero commented Feb 21, 2017

@mherodev trying to distill your issue here, is it that the "last active window" is not properly restored when you have this setting on and you restart after a quit?

@michaeljonathanblack
Copy link
Author

Correct.

The "last active window" will often be erroneously set to another window that manages to close before the true "last active window", so the wrong window is restored.

@bpasero bpasero reopened this Feb 21, 2017
@bpasero bpasero added the bug Issue identified by VS Code Team member as probable bug label Feb 21, 2017
@bpasero bpasero added this to the February 2017 milestone Feb 21, 2017
@bpasero bpasero changed the title When quitting (cmd+q) and opening VS Code, not all previously-open windows open Last active window is not always restored when reopening Feb 21, 2017
@bpasero bpasero modified the milestones: February 2017, March 2017 Feb 21, 2017
@bpasero
Copy link
Member

bpasero commented Feb 26, 2017

There are two bugs actually:

  • when window.reopenFolders is set to one (default) and you open many windows and quit, the next session will open a random window from the previous session, not necessarely the last active
  • when window.reopenFolders is set to all, the same bug shows up, but less annoying, its just the last active window is not focussed

@michaeljonathanblack
Copy link
Author

Awesome, thanks @bpasero!

@roblourens roblourens added the verified Verification succeeded label Mar 30, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants