You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Unsaved buffer state isn't silently preserved when the Window has no project folder #13318
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.
Reacted by Asbjørn Ulsberg, Ryan, Arkadiusz Seidel, Alex Staravoitau, Andrey Mavlyanov, Charles (Ted) Wise, Linus Eriksson, James Milazzo, Kentaro Kaji, Cody and 29 more
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:
When the Computer loses power (laptop runs out of battery).
When the Application/System freezes so that the process has to be killed.
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.
Reacted by Cody, JuDelCo, Asbjørn Ulsberg, Joseph W. Dougherty, Christopher Bowns, Vivek Sethi, Joshua Coady, David Koerdt, Reslav Hollós, Graham Scanlon and 12 more
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.
Then Firefox used Atom to open some file I downloaded and all the sessions (and unsaved buffers) are lost.
Where does Atom save the sessions and unsaved files content? Is there a way to get the sessions back?
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.
I just instal Atom 1.13 beta and works "fine"!
Using W10x64 - Atom 1.13
PD: If I open the tree-view I can see that desktop is linked, probably is using it as project.
PD2: If I open other project the oldest buffer (not saved file) is not showed, but if I open no project again (desktop) I have the old buffer.
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.
Reacted by JuDelCo, Andrey Mavlyanov, Norberto Esteves, Bjarke Felbo, apasika, sreith1, Ikram Babajanov, stephenykp and Glenn Tanner
@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?
Reacted by Will, mda6, Christopher Bowns, Norberto Esteves, cesare soldini, Dongkyu Han, Joshua Coady, Melvin Ram, Helder Pereira, Bjarke Felbo and 4 more
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
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.
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. 🙏❤️
Reacted by ThatXliner, Clement Hardy, tom-newhall and Giuseppe Passino
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 ~/.atom/default-project. (Optional: Hide the unhelpful "Project" pane on the left.) Now any open files and any newly opened files seem to be assigned to that default project and hence they get saved/restored as I expect. Or at least I haven't found a corner case where this workaround breaks so far. E.g. things like atom somefile.txt on the shell work fine.
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 autosave and autosave-onchange were enabled in the previous session.
@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?
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. 🙏❤️
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 😞
Activity
rreinhardt commentedon Dec 11, 2016
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:
When the Computer loses power (laptop runs out of battery).
When the Application/System freezes so that the process has to be killed.
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.
hydrandt commentedon Dec 18, 2016
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.
Then Firefox used Atom to open some file I downloaded and all the sessions (and unsaved buffers) are lost.
Where does Atom save the sessions and unsaved files content? Is there a way to get the sessions back?
winstliu commentedon Dec 18, 2016
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.
Curros commentedon Jan 5, 2017
Wow I just expend 1h looking to all the mess around this "bug".
I'm using W10x64 - Atom 1.12, and i have the same issue.
@50Wliu if the file is not saved, you lost it. Even using Ctrl+Shift+T
Curros commentedon Jan 5, 2017
I just instal Atom 1.13 beta and works "fine"!
Using W10x64 - Atom 1.13
PD: If I open the tree-view I can see that desktop is linked, probably is using it as project.
PD2: If I open other project the oldest buffer (not saved file) is not showed, but if I open no project again (desktop) I have the old buffer.
ctwise commentedon Jan 5, 2017
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.
winstliu commentedon Jan 5, 2017
@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.
lePereT commentedon Jan 6, 2017
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?
ctwise commentedon Jan 6, 2017
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.
winstliu commentedon Jan 6, 2017
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.
lePereT commentedon Jan 6, 2017
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
caesarsol commentedon Feb 23, 2017
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?
bnlawrence commentedon Mar 1, 2017
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.
31 remaining items
aronj commentedon Mar 12, 2019
soleares commentedon Apr 6, 2019
@Ashkaan Most editors I've used on the Mac support this. BBEdit also does.
mjarmijo commentedon Jan 29, 2020
Just lost some data from my laptop restarting over night. Would really like this feature!
thargenediad commentedon Sep 24, 2020
Please add this feature! It's the sole reason Atom isn't my main text editor.
CommanderPirx commentedon Dec 7, 2020
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...
bean-drew commentedon Jan 6, 2021
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?
corsel commentedon Feb 25, 2021
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++.
JoshCheek commentedon Mar 24, 2021
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. 🙏❤️
Philipp91 commentedon Apr 11, 2021
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
~/.atom/default-project. (Optional: Hide the unhelpful "Project" pane on the left.) Now any open files and any newly opened files seem to be assigned to that default project and hence they get saved/restored as I expect. Or at least I haven't found a corner case where this workaround breaks so far. E.g. things likeatom somefile.txton the shell work fine.tom-newhall commentedon Aug 18, 2021
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
autosaveandautosave-onchangewere enabled in the previous session.Is that correct?
Thank you.
bobemoe commentedon Aug 18, 2021
@tom-newhall there is sort of a way, see the workaround mentioned in the post above yours. i.e always have an open project.
tom-newhall commentedon Aug 18, 2021
@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
JoshCheek commentedon Sep 17, 2021
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 😞
icecream17 commentedon Sep 17, 2021
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?