zed icon indicating copy to clipboard operation
zed copied to clipboard

Restore previous workspace on application resume

Open williamviktorsson opened this issue 1 year ago • 4 comments

Addresses #10812

Release Notes:

  • Launching an empty already-running Zed application now behaves like a regular startup and respects the user resume_on_startup setting. (#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

williamviktorsson avatar Apr 20 '24 19:04 williamviktorsson

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.

ConradIrwin avatar Apr 25 '24 03:04 ConradIrwin

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?

williamviktorsson avatar Apr 25 '24 07:04 williamviktorsson

Go for it!

ConradIrwin avatar Apr 25 '24 14:04 ConradIrwin

Edit: updated PR description to reflect changes.

williamviktorsson avatar Apr 28 '24 07:04 williamviktorsson