-
Notifications
You must be signed in to change notification settings - Fork 17.4k
Unsaved buffer state isn't silently preserved when the Window has no project folder #13318
Comments
I would like to suggest the addition of the label "data-loss" to this issue. Having followed along from #10474, I think it's worth commenting that preserving the unsaved buffer state is important for non-project documents because of situations where Atom is closed without having the time/ability to offer up the save prompt to the user. A couple cases that have resulted in data loss for me in the past:
I also think there is greater usability for the application to constantly be at a saved state than have the user make a decision(s) at the time of closing the application. |
I currently use Atom 1.8.0 on debian unstable, and the session/buffer saving has been working fine for quite a while, even for two atom windows in two different KDE activities. |
Atom 1.13.0 features a new Reopen Project feature that you can use to return to your old projects. Otherwise you would have to reopen the folder/folders that you were editing. |
Wow I just expend 1h looking to all the mess around this "bug". @50Wliu if the file is not saved, you lost it. Even using Ctrl+Shift+T |
I just instal Atom 1.13 beta and works "fine"! PD: If I open the tree-view I can see that desktop is linked, probably is using it as project. |
Nope, Atom 1.13 beta still isn't working. It requires you to save the buffers. Sublime doesn't. That makes it perfect for scratch pads, open a new tab and start typing and pasting. Close Sublime, open it back up and the untitled buffers are still there. |
@Curros I think you misunderstand this Issue. When there is no project folder open, Atom is (currently) incapable of saving the editor's state. Before, it would throw it away, which led to data loss. Now, it asks to save those files, which is considerably better than before, but still not at where we would like it to be - a consistent saving experience with or without project folders. |
I think that Atom could certainly learn from Sublime's default behaviour here. There are times when I've reopened Sublime after some days and found work/musings that I'd not even remembered I'd lost. This makes it a perfect environment to work in. Atom, I've been burned twice on 1.12 already. The 1.13 beta behaviour is better, but still unpredictable and therefore poor. What's the technical barrier to implementing this fix? |
I believe they made a technical decision that contents of tabs are tied to "projects". No project, no auto-saving of content. I'm guessing that this issue would require some re-architecting of that approach and they really don't want to do that. |
Yeah, @ctwise is pretty close. We choose the state key by passing in the open project folders and computing a SHA1 of that. If there's no open project folders, then we don't compute a key and hence the state doesn't get saved. That being said, I did just rediscover #11122. I'll try to get some 👀 on it. |
Would be great, cheers. Even VS Code has recently added this behaviour in the form of 'hot exit' I think. I found it pretty invaluable when working on a desktop in Ghana last week with rolling blackouts. Pretty extreme coding :D |
Hello, I'm coming from Sublime as well and expected this feature! Would be wonderful to have it back 😄 Could a strategy be to associate a common default project to all project-less tabs? |
So, I don't think the "fix for telling me to save" (this one?) even works. As far as I can tell (1.14.4 on Mac Yosemite) atom still just silently kills my data when I close the window, no prompt, just data loss. Like everyone else, I'm so disappointed. Atom seems like magic, with the potential to really improve my workflow, but it has this yawning fatal problem. Not everything is a project ... and when things are time critical, I'd rather be working slower and know I wont have to do things twice than working faster but losing stuff. I can't risk this, so like many others, it's back to sublime. |
Or try VS Code. It’s rather brilliant.
… On 1 Mar 2017, at 21:31, Bryan Lawrence ***@***.***> wrote:
So, I don't think the "fix for telling me to save" (this one? <stereobooster/atom@c6a89a4> even works. As far as I can tell (1.14.4 on Mac Yosemite) atom still just silently kills my data when I close the window, no prompt, just data loss. Like everyone else, I'm so disappointed. Atom seems like magic, with the potential to really improve my workflow, but it has this yawning fatal problem. Not everything is a project ... and when things are time critical, I'd rather be working slower and know I wont have to do things twice than working faster but losing stuff.
I can't risk this, so like many others, it's back to sublime.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#13318 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AEtLdCXjgPF7jhq6hjymzdVVN98yHWqBks5rheOZgaJpZM4K7DVD>.
|
This issue is about better "hot exit" functionality, which I agree would be nice. But data loss is obviously critical and we'd like to address it more urgently. @bnlawrence can you tell us how you got to this state? (e.g. how did you open Atom? Is it an empty environment or are there projects? How are you closing Atom?) The fix you linked is working for others. |
Hmm. Of course it's not repeatable today.
But today, I have some projects, and even though I'm doing this in a different folder starting with no editors open, I'm assuming it's somehow associated with a pre-existing project. Unfortunately I have to do my day job, I'll try and get back to experimenting with atom, and this issue, within 48 hours. |
Thanks for trying. Please do let us know if you can reproduce it as we take this kind of bug seriously. Just to be clear, in the current release:
We would like to make the second case behave like the first at some point but it hasn't yet been prioritized. |
Experience playing with Atom
** then I put my old .atom directory back **
|
@bnlawrence To clarify:
@ungb Can you please take a look at the above report. Can it be related to #13873? |
Sorry, I've been very poor with my choice of words. "Crash editor" above means "close by terminating window, as opposed to via a menu choice". |
Hey @bnlawrence, It could be related to issue #13873, depending on what steps you took for the steps where you When you just close Atom via the red button on mac, Atom is still open if you are on mac. This is a feature on mac that isn't available on other OS. For now, if you open the file from terminal it should work via |
Does anyone have any update to when this will be looked into? I tried investigating today, but it's way above my head. It seems most of the logic is in the project.coffee file, and I assume that's why it only works with projects. (at least this is my assumption). I really want to move to Atom, but this is the one thing I just can't live without. |
Hi there! I'm new to Git and to the Atom project, so please be patient with me! I come from Windows and Notepad++, so this particular issue really stood out to me from the first time I used it. I can reproduce this issue (maybe two issues?) in Atom 1.16.0 on MacOS Sierra. I have documents I've opened in Atom (originally created in Atom too) that are saved in ~/Documents or its subdirectories. When I open an existing document, make edits, and close with the red button, it never prompts me to save and changes are not saved automatically. When I instead create a new document on an untitled tab, I am prompted to save. Additionally, the only way that I seem to be able to get the state of the window to save (ie, all of the tabs I had open the last time I was working are still open the next time I start Atom), is to save all work in each tab, then shut down my computer without closing the window or quitting the application. If I do this (even if I do not choose the option to re-open windows on startup), my state is saved. I hope this helps someone! Please let me know if I can help with a solution, but I am an absolute beginner here. |
@aism I feel your frustration. This was the exact reason why I moved back to sublime. Well, this and how Atom used to compete with Chrome in "who'll eat the most RAM on this computer" contest. |
On multiple occasions in the last few weeks, I have had Atom crash on me and I've lost all unsaved changes (tabs with unsaved changes are not restored). I'm running version 1.29.0. Have I missed a setting somewhere? Why is this not automatically handled? Notepad++ has had no problem doing this for at least the last few years. Would it be best to ditch Atom and go back to using Notepad++? |
Thanks for this issue, I just got hit by this bug last week, and this was helpful to understand the scope of the issue. :( I get the reality of it, but was surprised still this was an issue. The use case that got me to here was opening up a clean ATOM window to do some scratch work while working on another project. I wanted a clean workspace and panes, so Regardless, at some point my computer got unhappy with me, a reboot happened. I guess I always assumed there was some sort of default project (even hiding in .atom somehow) that this new window opened with, but alas, there was not, and my files were 🗑 . Atom is so good at reopening old projects and files (and project state), it was surprising to find this gap. At least I know this now! |
Yeah, so bad it has inconsistent behavior here. Sometimes saves, sometimes not. Lost quite a bit of unfinished data because of that. |
@iolsen, are you guys still planning to add this feature any time soon? I'm on MacOS and my options for a useful (to me) text editor are slim. Right now, Sublime is the only one I'm aware of that has this functionality. I've tried Brackets and Atom. If Notepad++ were (easily) available on MacOS, I'd go there. @everyoneelse, are there any text editors that I should try that can do this just as Notepad++ and Sublime can? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@Ashkaan Most editors I've used on the Mac support this. BBEdit also does. |
Just lost some data from my laptop restarting over night. Would really like this feature! |
Please add this feature! It's the sole reason Atom isn't my main text editor. |
I can't believe it's been literal years since the lack of this feature has been highlighted for the first time and countless time people chimed in in the meantime about it, and yet nothing has been done about it. It's most basic and fundamental feature any worthwhile text editor should have. I just bounced off of Atom HARD because of it. Oh well, I guess back to looking for an alternative editor... |
Looking for a free lightweight text editor for Mac (ie. Notepad++, but for Mac) and was recommended Atom. Figured out how to disable the project pane (via disabling a package), only to find (here, now) that the failure of session-save was because I wasn't opening my documents as part of a project ... Why does Atom need me working in projects - That does not align with my workflow. It also seems a bizarre omission, given wide adoption of this mode across other editors. However, across this thread and the linked "Unsaved buffers" thread it seems that this has been a long-identified issue that isn't changing. So per comments I've seen here I guess it's off to try Sublime [edit: not free]. Otherwise Atom looked nice, so, feature request? |
Wow, I wasn't expecting to see so much heat around this for literally years when I decided to give atom a try and shortly after started looking up google how to keep the unsaved session. I guess I'm also switching back to notepad++. |
This hits me very frequently (probably several times a month for the last several months, though there were times it happened multiple times per day) and it's the primary reason I'm looking at other editors. I've lost important meeting notes, todo lists, code snippets I was composing from REPL sessions, etc. Perhaps it should be noted that I am almost always working on unsaved files. I dev in vim, and take notes / paste things I want to get out of the clipboard / experiment in Atom. So the idea of a project root or a file path is foreign to my mental model when using Atom, I am 99% of the time thinking about operations on an in-memory buffer. And it's just brutal to lose 10 buffers with important notes for the second or third time in a week. I'd super appreciate a priority elevation for this issue. While I came here to express this frustration, I've generally been >90% happy with Atom for 6 or 7 years now, so want to make sure to say ty times a million to the maintainers. 🙏❤️ |
I only need a text editor for single files, as I have other (language-specific) IDEs for programming. This means that I can use a workaround for this issue in Atom: Menu "File -> Add Project Folder" and specify sth like |
Hi, I'm something of a Newb with Atom. I just want to confirm my understanding of the above issue---as of version 1.58.0 (using on 8/18/21)---there is no way to recover unsaved data from a previous session, even if Is that correct? Thank you. |
@tom-newhall there is sort of a way, see the workaround mentioned in the post above yours. i.e always have an open project. |
@bobemoe Thank you for that; that workaround appears to work, for now at least. (I added my dropbox root as my ("default") 'project folder'; opened a new file in Atom; added some content; did not save it; restarted the computer. The file and content was there when I restarted atom) Now that I've "Added" a "project folder" (added to what, I wonder?) should that stay as my "default" project folder on this machine, or do I need to re-"add" this folder every time I restart Atom from scratch? Is there a way I can check what "project folders" have been "added" to Atom? Thanks again for the help |
sigh this is so absolutely tortureously brutal. Also, it's a regression, because this did not used to happen. I can't tell whether I'm lazy or a masochist for continuing to use Atom. It would be deeply appreciated if someone on the Atom team would at least acknowledge that this is a serious this issue. Literally every time my laptop runs out of power, I lose every single open buffer. Usually this is ten to twenty buffers. I put off restarting my computer because I don't want to lose what's in my buffers, but then I'm distracted and run out of battery and lose them anyway 😞 |
Added to todo list. But I have a lot of things going on in my personal life. Since there's not many contributors, Could this be a workaround? #9968 (comment) Helpful for future me: #10474 (comment) > #9968 (comment) Does anyone know where the code dealing with saving buffers is? |
Unsaved buffer state is preserved as part of the project system. When there is no project, it doesn't get saved. Prior to this fix this behavior could result in data loss. That's now fixed, but seamlessly preserving state as Atom does for projects would be more convenient and is the more elegant fix.
We would readily accept a well-tested PR providing this functionality.
See also #10474.
The text was updated successfully, but these errors were encountered: