How to restore your previously opened tabs even non-saved files?


#1

Hello!

I’m feeling stupid to ask this when my web searches have shown me it seems to be a core feature, but I just can’t get Atom to reopen, upon starting the program, the tabs that were previously open.

Even when they’re not locally saved to disk, or at least part of an official Project.

At the present time, as things are, Atom only restores the existing files, such as a local .php file.
If I simply create a new file, start writing in it… I can kiss it goodbye when I close Atom.

I checked there was already an “Autosave” package, in its settings I made sure it is Enabled. Still didn’t help :smiley:

I imagine It must be something extremely obvious, haha. Really, if someone can tell me how I can achieve that, that’ll be nice of you.

(edits: spelling.)


So very, very close
#2

Saving and restoring untitled buffers is something that should be in v1.4.0 and above:

You need to have a “project” open and re-open the same “project”. But the idea of a project is really fluid. Basically, a project is defined as, in Atom, a specific set of “root folders”. So if I start Atom with atom ~/foo, ~/foo is the definition of the project. To restore whatever state (including open tabs) that were open when I closed Atom … I can start Atom again with atom ~/foo.

Atom’s concept of projects is kind of confusing and I’ve opened an Issue for us to design better systems. Right now the team is focusing on several performance-related things, so it isn’t clear when we’ll be able to get to rearchitecting this.


#3

Thanks for your answer, Leedholm!

I now know which keywords to search next time I want to see if that has been addeed to Atom, that’s an added benefit :smiley:

I will check again in a pair of months to see, I guess.


#4

Your discussion of projects indicates you don’t clearly understand the issue. The issue is that buffers aren’t saved when you simply open Atom and create a buffer. When I start Atom without a “project” or a starting file, that shouldn’t impact the saving of unnamed buffers. But it does. Even worse, with the new behavior it no longer prompts to save the buffers.

At minimum, the behavior of unnamed buffers should be consistent whether a “project” is open or not. At best, unnamed buffers should be saved in both cases.


#5

I’m actually really familiar with the issues you’re describing, @ctwise. I’ve documented it here:

It is something that I am pushing the Atom team to spend some time to dig into and resolve. If there is something I’ve missed there, your feedback is more than welcome.


#6

@leedohm While it looks like you’ve already included this issue in your launch story link, I’m curious if you know of any way to view history if indexedDB is wiped. I just used --clear-window-state to fix a small panes problem in one project after a plugin update. --clear-window-state apparently wiped all the tabs in all projects, including all the content in all my unnamed, unsaved tabs in other projects, with no warning. I think I just lost a bunch of notes taken during project-related phone calls.

I save all my atom data to an auto-versioning dropbox directory in case of editor weirdness like this. However, indexedDB state storage breaks file-based versioning. Any idea if there’s still a way to access untitled buffer data after --clear-window-state? If not, do you know of a plugin that outputs untitled buffers to a temporary directory? I can’t find one. I also looked through the code to see if I could figure it out, and don’t see a quick way to get the latest state and dump it to a file. Already spent about 4 hours trying to figure this out and get those notes back, or at least prevent it from happening in the future. Any insights appreciated.


#7

I have absolutely no idea of what any of you are talking about because I’m not a programmer but nonetheless I came here for the same reason, :joy: I’d like Atom to restore whatever it had when I quit it to clear the clutter but it’s the only app on the system that asks me to save changes. :sleepy: I’ve been only using it for maybe a couple of weeks tops but I’m liking it better than my go to, TextWrangler.


#8

If you simply quit Atom, it will reopen all previously opened projects and files. If you closed a single window, you can get the state back by reopening that specific set of project folders.


#9

I’ve tried but it asks me to save the document, it won’t just quit. I think you mean for documents that already have been named and placed somewhere on storage. :nerd_face:


#10

Atom has never asked me to save a file.


#11

It sometimes asks me. I think that is when I haven’t swapped panes / windows / applications, so the save on lose focus doesn’t kick in.