zed icon indicating copy to clipboard operation
zed copied to clipboard

Last manually-closed workspace reopens on Zed startup

Open noinfo opened this issue 1 year ago • 8 comments

Summary (quoting @notpeter): If you close the workspace (cmd+w) before quitting (cmd+q) when you come back, Zed reopens that workspace instead of giving you a blank window. This behavior differs what other editors do and thus what some users will expect.

Describe the bug / provide steps to reproduce it

I have downloaded zed and opened a folder as a project. When I close the project I habe zed in the state that I want it in on startup. However whenever I start up zed it opens the closed project again.

I can not close the project and have it stay closed. It always reopens on its own.

noinfo avatar Feb 14 '24 08:02 noinfo

Are you looking for something different than setting "restore_on_startup": "none" in your settings.json?

williamviktorsson avatar Apr 20 '24 18:04 williamviktorsson

Yes, I think I do. When I actively remove any open projects from zed before closing, I expect it to open "empty" as I left it. But it does'nt. It will restore to the last project I had opened instead of the bare, empty state. I do want to it to reopen to a project if I left it open. But I also want it to restore to empty if I consciously do so before closing.

noinfo avatar Apr 24 '24 08:04 noinfo

Are you looking for something different than setting "restore_on_startup": "none" in your settings.json?

I tried using this as a work around - even though it's not what I want - and noticed something interesting (probably another issue). The setting works when launching from the macOS GUI, Spotlight or Alfred.app. The setting does not do anything at all when launching from the CLI. It launches a second window that will also reopen the last opened project. Opening the settings there will show that "restore_on_startup": "none" is correctly set however.

noinfo avatar Apr 25 '24 07:04 noinfo

Are you looking for something different than setting "restore_on_startup": "none" in your settings.json?

I tried using this as a work around - even though it's not what I want - and noticed something interesting (probably another issue). The setting works when launching from the macOS GUI, Spotlight or Alfred.app. The setting does not do anything at all when launching from the CLI. It launches a second window that will also reopen the last opened project. Opening the settings there will show that "restore_on_startup": "none" is correctly set however.

This is actually a different issue:

  • #9592

I take it you want Zed to open with an empty project, should you have exited the application in the below displayed state?

Screenshot 2024-04-25 at 09 49 55

williamviktorsson avatar Apr 25 '24 07:04 williamviktorsson

I can duplicate this with current releases. If you close the workspace (cmd+w) before quitting (cmd+q) when you come back, Zed reopens that workspace instead of giving you a blank window. This behavior differs what other editors do and thus what some users will expect.

notpeter avatar Jun 27 '24 17:06 notpeter

~On Linux, "restore_on_startup": "none" setting does not work. The editor still opens the folder from the last session.~

In version 0.146.3 the setting works properly.

lufog avatar Jul 18 '24 18:07 lufog

Was having the same issue here. Tried "restore_on_startup": "none" in settings.json and it did prevent previously worked on projects from opening. But the issue isn't entirely fixed because when opening up a project using the cli you should expect the project to be the only one that opens, however now I am getting the project I wanted opened as well as a blank project.

Kan5661 avatar Aug 12 '24 17:08 Kan5661