Repository navigation
Reopen windows when starting app w/ no arguments - #6380
Conversation
There was a problem hiding this comment.
Should this use stateString here?
There was a problem hiding this comment.
Yeah, thanks. I think I'm going to 🔥 this and extract a couple of helper functions for working with the storage directory here and in atom.coffee.
04eb4d5 to
d89d5b7
Compare
d89d5b7 to
8f06301
Compare
|
Ok, specs are good; the TextEditorComponent spec fixes just aren't on this branch. |
Reopen windows when starting app w/ no arguments
There was a problem hiding this comment.
You don't need the utf8 here, JSON.parse handles Buffer objects.
There was a problem hiding this comment.
Should it be deleted after it is read? So if Atom is crashing because of the window state it doesn't keep retrying on subsequent launches.
There was a problem hiding this comment.
Maybe, but I think we should make that it's own issue, just because it'd be a little bit of a behavior change from what we have now, and I think it'd take a little testing to make sure we didn't ever unintentionally wipe out the user's state.
|
SHIIIIIT. This will make soo many people happy |
|
One piece of feedback: it doesnt keep the active window. So on restart the focused window may not be the window focused on quit. Other than that, it's great 🎉 |
There was a problem hiding this comment.
Looks like Atom fails to start if this error is thrown, should it just resort to the default window in this case instead?
There was a problem hiding this comment.
Yeah, thanks for catching that. Fixing that up on master.
Yeah, we should do this. I opened a separate issue for it since it's not totally trivial to do. |
|
❤️ You're amazing @maxbrunsfeld. |
|
This PR doesn't do autosave, does it? Is there another issue beside #1603, or another PR, on that?
|
|
@jacekkopecky does the built-in autosave package do what you want? It saves all buffers whenever the application loses focus. |
|
@maxbrunsfeld I think @jacekkopecky might mean to autosave of the application state, rather than the buffers themselves. |
|
Oh, yeah. Currently, the application state is only saved on quit. |
|
Regarding the application crash use case: I think autosaving the contents of open buffers is critical because it prevents work from being lost. I don't think autosaving the opened windows falls into that category though; I'd rather address that problem by reducing the frequency of crashes. @jacekkopecky That said, if Atom is crashing on you often enough that reopening your opened windows would be a major improvement, then maybe we should implement that feature. Feel free to open a new issue for this. |
|
@maxbrunsfeld I think it's critical. It's not about atom crashing or not crashing. It's about a myriad of other things crashing on a computer. It's about being able to not kill a junior because he or she accidentally hit the reset button on your computer. Sublime gives you the "don't worry about it" guarantee. It's a state of mind and affects your workflow. I was used to having many unnamed buffers open with random scratch data. I didn't need to save it anywhere but sublime kept them around. |
|
Ok @mehcode could you open an issue for that feature?
I think this use case is covered though, because Atom should quit normally during a system restart (at least on OSX and Linux). |
|
We are moving forward with this idea with save-workspace plugin. It give opportunity to save whole workspace (tabs, splitting, project folders opened, etc.) and move between them very fast. |

~/.atom/storageCloses #1603.