zed icon indicating copy to clipboard operation
zed copied to clipboard

Zed stopped restoring sessions after an update

Open golddranks opened this issue 10 months ago • 15 comments

Summary

Zed stopped restoring sessions after an update

Steps to trigger the problem:

  1. Open Zed
  2. Open some tabs, maybe some new, some file-backed
  3. Close the program with cmd-Q
  4. Open it again

Actual Behavior: Zed starts with a single empty tab

Expected Behavior: Zed would restore the session I had when closing the program

Zed Version and System Specs

Zed: v0.173.10 (Zed) OS: macOS 15.1.1 Memory: 64 GiB Architecture: aarch64

golddranks avatar Feb 17 '25 16:02 golddranks

Hey @golddranks - sorry about this, that doesn't feel like a good experience. I wonder if the local SQLite db somehow was corrupted. Can you move the 0-stable database directory located at ~/Library/Application Support/Zed/db to another location (for backup) and restart Zed and see if the issue resolves or persists?

JosephTLyons avatar Feb 18 '25 05:02 JosephTLyons

Hi, I renamed 0-stable as 0-stable.old. A new 0-stable was created on startup, and Zed show a "first time" startup screen.

However, the issue persists.

Just to be sure, Zed is supposed to restore the last session with default settings, isn't it? (It used to do this, at least.)

golddranks avatar Feb 20 '25 06:02 golddranks

I am also experiencing this. I would love to know if you find a solution.

owencmcgrath avatar Feb 21 '25 18:02 owencmcgrath

We have a setting called restore_on_startup is that by any change set on "none"? What happens if you actually set this to "last_session"?

devzeth avatar Feb 21 '25 18:02 devzeth

@beniaminzagan

I apologize for my late reply. This solved my issue, but I cannot speak for @golddranks.

My reason for commenting was because I had previously set this setting to "last_session" and was confused by the change in functionality.

Thank you for your help.

owencmcgrath avatar Feb 24 '25 00:02 owencmcgrath

I'm taking a week off right now, but I'll come back to this next week! Thanks for your kind support!

golddranks avatar Feb 24 '25 00:02 golddranks

Of course! Enjoy your time away.

Make sure to shut your notifications off. 😄

owencmcgrath avatar Feb 24 '25 00:02 owencmcgrath

hey, i just installed Zed for the first time (on Windows 11, via Scoop) and have had the same issue since installing.

even after finding the restore_on_startup option and explicitly setting it (tried both last_session and last_workspace) and the issue is persisting.

wasn't sure if it was just due to not being officially supported on Windows yet, but if others are experiencing it too, just wanted to add my two cents from the Windows side.

EDIT: just realized i should add - Zed does at least restore with the last worked on project folder being open in the editor, but none of my previously opened tabs are restored.

alefnull avatar Mar 01 '25 02:03 alefnull

#25870 should fix this for Windows. @golddranks If the issue persists on your end, we could reopen this issue.

JunkuiZhang avatar Mar 01 '25 17:03 JunkuiZhang

I'm facing the same issue on macOS even with "restore_on_startup": "last_session" explicitly added in settings.json.

Zed v0.176.1

agarwalvishal avatar Mar 04 '25 17:03 agarwalvishal

Have the latest now 0.182.11 and having the same issue (on Ubuntu Linux).

About the restore_on_startup setting, it's not clear what is the difference between last_workspace and last_session, workspace doesn't seem to be a thing anymore, I don't see any option in the menu to create or manage workspaces, if I open the palette and execute workspace: save nothing seems to be happened. What's the point of having workspaces if when saving it I cannot even provide a name to it, are workspaces still supported?

mrsarm avatar Apr 22 '25 00:04 mrsarm

Can confirm, on macOS. This is an incredibly annoying—and workflow-disruptive—regression.

danielbayley avatar Apr 22 '25 12:04 danielbayley

Same issue macos, and remain unclear what the solution is?

m0rg5 avatar Apr 27 '25 11:04 m0rg5

It seems that this bugs comes and goes for different people. For me, it fortunately stopped reproducing, but without apparent fix/reason why it would have been resolved.

If the reason is not apparent for developers and users, maybe there could be better logs/debugging to get to the root of it?

golddranks avatar Apr 28 '25 04:04 golddranks

I've created more than a dozen different projects, added several different folders to each—basically set everything up nicely—but when closing Zed, it just FORGOT ALL MY PROJECTS. It's silly to rely on some mythical internal algorithms for storing projects. Please implement a proper settings system using project files, like in VS Code, so that I can at least perform backups instead of wasting 10 minutes every day recreating my project hierarchy. Right now, Zed is simply unusable(

ghost avatar Apr 30 '25 11:04 ghost

I have the same problem unfortunately – I'm running 0.190.5 on macOS Sequoia 15.5.

IsaacCheng9 avatar Jun 12 '25 21:06 IsaacCheng9

I had an untitled buffer in Zed where I kept some very important notes, it grew rather large and I just fell victim to this bug. The entire buffer with my notes is gone. This had never happened to me before with Sublime Text or VSCode, and with the former those buffers were somewhere on your disk (as plain text or in some JSON file, it escapes me), so even if you somehow completely bricked Sublime Text, you were still able to easily recover them. Not the case with Zed, I just went through all the SQLite database's tables' records with no luck. This is an extremely destructive side effect that led to loss of very valuable information.

As @ghost said, Zed is unusable like this and at least for me, this was a very important blocker to switch over to Zed (as I commented on the related issue).

EDIT: With some hacking I was able to partially recover the contents using a hex editor on the .sqlite file -- it was probably dangling somewhere in a deallocated space

muja avatar Jul 15 '25 16:07 muja

I'm experiencing the same issue on Ubuntu 22.04 with version 0.197.3

jayschell avatar Jul 31 '25 15:07 jayschell

I'm still experiencing this bug.

I have tried setting "restore_on_startup": "last_session", "restore_on_startup": "last_workspace", and removing the setting to rely on the default. None of these preserve my session when quitting and re-opening.

These options were pulled from the docs: https://zed.dev/docs/configuring-zed#restore-on-startup

My environment:

OS: macOS 15.5 Zed: 0.198.6

pouriaalmassi avatar Aug 12 '25 16:08 pouriaalmassi

Can confirm "restore_on_startup": "last_session" DOES NOT work on the latest macOS & Zed versions. It's pretty disruptive for doing stuff.

OS: macOS 15.6 Zed: 0.198.6

foxness avatar Aug 13 '25 06:08 foxness

New user here. Had to read through several feature request issues, before finding this one and realizing the feature was already implemented but is now broken. :(

Zed:

Zed 0.202.7

OS:

VERSION="2025.3"
VERSION_CODENAME=kali-rolling
ID=kali
ID_LIKE=debian

rubaboo avatar Sep 06 '25 09:09 rubaboo

Update: Turns out (https://github.com/zed-industries/zed/issues/15098#issuecomment-2630981105) I had to open a local folder, and now session is getting restored. It's possible (at least some of) the earlier "me too" replies are from new users like me.

rubaboo avatar Sep 06 '25 09:09 rubaboo

Thanks. The "open a local folder" work-around works for #metoo. 😃 If that is not something the devs plan to fix anytime soon many desperate users would probably be totally grateful for an honored mentioning of this insufficiency in the documentation. Please add this to the docu advising "restore_on_startup": "last_session". Thank you! People loose work because of this bug.

a8 avatar Sep 09 '25 22:09 a8

i have same problem with restoring last session, this bug still not fix?

andrewle9510 avatar Oct 19 '25 11:10 andrewle9510

unfortunately, I haven't figured out how to do this so that I always have all open files after restarting (even with workaround with dummy workspace) and can also open new files from the terminal these files are either not added to the current session/workspace or open in a new, completely empty window where the previous files are not present

brozikcz avatar Oct 26 '25 11:10 brozikcz

  • macOS 26
  • uninstalled Zed
  • deleted ~/.config/zed
  • deleted ~/Library/Application Support/Zed/db
  • installed Zed
  • opened file
  • closed (cmd + q)
  • re-opened
  • nothing restored

yeah, not great :)

ghbob avatar Nov 27 '25 10:11 ghbob

ok, maybe it's just my reading comprehension, sorry:

Restore all workspaces that were open when quitting Zed

(https://zed.dev/docs/configuring-zed#restore-on-startup)

single files not in a workspace / local folder are apparently not a "session".

tbf the settings menu is a bit more vague:

Restore On Startup What to restore from the previous session when opening Zed.

ghbob avatar Nov 27 '25 10:11 ghbob