Restore previous workspace on application resume
Addresses #10812
Release Notes:
- Launching an empty already-running Zed application now behaves like a regular startup and respects the user
resume_on_startupsetting. (#10812).
See attached showcase which highlights how the previous project can now be re-opened through both "quit" and "close window".
This has a noticeable performance benefit on startup/project resume time.
This should also make the behaviour of closing/opening an application consistent between macOS/Linux/Windows.
https://github.com/zed-industries/zed/assets/22855292/9c37ba31-ce0a-4c3d-940d-a56e3347e64a
Thanks for this!
It's interesting to think about this – in many ways macOS treats closing a window as different from closing an app; that said, the behavior you suggest makes a lot of sense to me (in particular an empty zed window is pretty useless, so I like the idea of defaulting to getting you back into a useful place more often).
Re: settings. I think the default should be the new behavior. I'm less sure if it need its own setting, maybe we can treat this the same as app startup? If we do keep the setting we should only have one struct for behavior instead of two.
Thanks for this!
It's interesting to think about this – in many ways macOS treats closing a window as different from closing an app; that said, the behavior you suggest makes a lot of sense to me (in particular an empty zed window is pretty useless, so I like the idea of defaulting to getting you back into a useful place more often).
Re: settings. I think the default should be the new behavior. I'm less sure if it need its own setting, maybe we can treat this the same as app startup? If we do keep the setting we should only have one struct for behavior instead of two.
If the distinction only exist on macOS it would make sense to make the setting apply to both. Would you like me to update the PR to reflect this change or would you like to propose the code changes?
Go for it!
Edit: updated PR description to reflect changes.