Autosave doesn't work for Unsaved Documents

Bug #151365 reported by Endolith
138
This bug affects 26 people
Affects Status Importance Assigned to Milestone
gedit
Confirmed
Wishlist
gedit (Ubuntu)
Triaged
Low
Unassigned

Bug Description

Autosave doesn't happen if the document has *never* been saved. It should,
since data can be lost if there is a crash while an unsaved document is in the
editor.

Endolith (endolith)
description: updated
Revision history for this message
Wrwrwr (wrwrwr) wrote :

Yes i can confirm that on gutsy (with enabled autosave option). To reproduce: open gedit, type a few characters and wait, kill it after some time. Seems it won't ever save anything.

I've run it with strace and, as far as i can tell, gedit never attempts to automatically save a new file.

Changed in gedit:
status: Unknown → New
Changed in gedit:
assignee: nobody → desktop-bugs
importance: Undecided → Low
status: Confirmed → Triaged
Revision history for this message
Tony Yarusso (tonyyarusso) wrote :

Confirming as still present in Hardy. Should perhaps create something like "unsaved1~" in the .gnome2/gedit directory, and offer to restore it on next run, similar to OpenOffice.org, or Epiphany/Firefox with tab sessions.

Revision history for this message
Endolith (endolith) wrote :

"Should perhaps create something like "unsaved1~" in the .gnome2/gedit directory,"

I'd prefer something with a datestamp in the Home directory. In fact, I think maybe all backup files should have a datestamp before the tilde, and it can save multiple backup files.

For unsaved files, maybe there shouldn't even be a tilde. We want it to be easy to find. If you close Gedit without saving, it will ask if you want to save. If you say no, there will be no emergency backup created. So the only time this file will be created is if Gedit has something in it and gets killed before you save. In this case, the file should be very visible and easy to find.

"and offer to restore it on next run, similar to OpenOffice.org, or Epiphany/Firefox with tab sessions."

Yes!

Revision history for this message
Saddy (sadmail) wrote :

Grrr I lost my data now due to this bug.

Revision history for this message
angryGeditUser (somemail-trash-mail) wrote :

Also grrr here....

Typing my eMails always in editor before sending them, my gnome-session just crashed after chaning xbacklight, and now i LOST ABOUT ONE HOUR OF TYPING THIS eMAIL!! - Why the heck dont you fix gedit to save an unsaved document tmp on whatever directory, if this feature is enabled in preferences???? - I have "Autosave files every 2 minutes" so i expect at least the things of the first 55 Minutes somewhere around my homedir, or this named out dir ~/.gnome2/gedit
But nada...

Repeatable: As often as you want if you dont save the file, and enable autosave....

My suggestion:
rename the text of the Preferences | Editor from "Autosave files every [textfield] minutes" to something similar like "Autosave files except unsaved files every [textfield] minutes", or to tell gedit to save the unsaved documents every xx minutes somewhere around homedir, or its own dir in .gnome2/gedit if enabled!

But like its now its not a feeature: Its really an annoying unneeded BUG!

Sorry for this language, im just a lil bit frustrated and want to push this bug up to get it fixed faster!

Changed in gedit (Ubuntu):
status: Triaged → Confirmed
Revision history for this message
Sebastien Bacher (seb128) wrote :

triaged means confirmed with enough information, why do you change it back to confirmed, do you think it requires extra details to be worked?

Changed in gedit (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Peter B P (peterbp) wrote :

I'd like an update on this as this bug / feature lack has been a problem for me for two years now.

Revision history for this message
Johan Fänge (d04jfa) wrote :

I just got hit by the same bug myself, so I wrote a python script to save backup of files.

It will save files as "filename.txt.unsaved" in the same folder as filename.txt or as "2010-06-05_02:53:40.Unsaved Document 1.unsaved.txt" in home.

Warning: It is not very untested.

Revision history for this message
Johan Fänge (d04jfa) wrote :

Uhm, I meant to say that it *is* untested, and also that it's a python plugin for gedit.

Revision history for this message
Ewan Sinclair (somebloke789) wrote :

This bug has been driving me up the wall. If it doesn't get fixed, I'm going to have to switch to a different editor. I have lost so much information that I had tapped into unsaved files before a battery drain or a crash occurred, and it seems that nobody cares to fix the issue.

"Scribes" appears to be what is needed here. It isn't nearly as nice as gedit, but at least it saves your text.

Revision history for this message
Ewan Sinclair (somebloke789) wrote :

My bad, scribes doesn't work either. Gvim will, but is also not as nice. I love gedit's tabs and simple layout :(

Changed in gedit:
importance: Unknown → Low
Revision history for this message
SteveLoughran (steve-loughran) wrote :

Seen this too, same problem: a laptop outage.

jedit does this, I'll be using it on the laptop.

Revision history for this message
Tony Yarusso (tonyyarusso) wrote :

Bump? It's been three years.... :S

Revision history for this message
Kostiantyn Rybnikov (k-bx) wrote :

D'oh! Electricy outage happened in a bad moment :-( Lost very important data. Hope this bug will be fixed one day.

Revision history for this message
John Teddy (masterjediyoda-gmail-deactivatedaccount) wrote :

gedit crashed before I saved, I had important data I lost. This bug probably affects a lot of people.

Revision history for this message
Abhinav Upadhyay (er-abhinav-upadhyay) wrote :

I remember having a chat with the Gedit developers regarding this bug. They believe that fixing this bug is not the solution, rather gedit should not crash at the first place.

Revision history for this message
Jamin W. Collins (jcollins) wrote :

Great logic. So, since cars and planes shouldn't crash perhaps we don't need safety features developed for them? Seriously, this is faulty logic. Software will from time to time crash. Sure, it shouldn't. But if reasonable steps can be taken to prevent data loss, they should. This doesn't really seem like an unreasonable step.

Revision history for this message
Abhinav Upadhyay (er-abhinav-upadhyay) wrote :

Sure, this is quite an old bug and yet it is still there. I guess they might be willing to fix it now. It would be great if someone from the Ubuntu Desktop team talks to them.

Revision history for this message
Johan Fänge (d04jfa) wrote :

For me gedit itself has never crashed, yet I've been affected multiple times by this bug.

Causes include:
 * loss of power
 * sudden freeze (Linux BSOD)
 * failed hibernation recovery
 * X11 killed after running out of memory
 * my own stupidity (accidental ctrl+c/kill -9)

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks guy, I don't think anyone here disagree on the fact it's an issue, Ubuntu doesn't write gedit though so you should better discuss the issue on https://bugzilla.gnome.org/show_bug.cgi?id=485471 where the software writes will read it

Changed in gedit (Ubuntu):
assignee: Ubuntu Desktop Bugs (desktop-bugs) → nobody
Revision history for this message
ray (arkibott) wrote :

That's the problem. Here we have a huge group of users and one bug tracking system but every project has it's own bug tracking system. I even have a gnome, kde and other bug tracking accounts but i don't report there since they also just say.. uh.. that's an ubuntu issue. Go somewhere else.

Back to the issue. I'm on precise testing.. gedit crashed and the unsaved docs are lost. This is a disappointing situation.

Revision history for this message
Mike (bild85) wrote :

I added my support for the bug over at Bugzilla. Another problem is that Autosave is not enabled by default. Is that a feature specific to Ubuntu or is it also something to bring up at Bugzilla?

Revision history for this message
Cefn (6-launchpad-net-cefn-com) wrote :

Maybe a comment will bring this bug back to life. This is very serious for my use of desktop linux - there's no excuse for program configurations which lose user-entered text by default.

Revision history for this message
HassaneDIABY (hasdiaby) wrote :

Hello!

We are 4 french students (University Paris 8) and we have to fix bugs on open source software for a class.
We searched among different bugs and softwares and this bug in gedit interested us. So we decided to work on it, hopefully fix it.

Alice, Hassane, Jazil, Oliver.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for working on that!

Revision history for this message
Saddy (sadmail) wrote :

Hope you'll fix it.

Revision history for this message
Laxmikant Gurnalkar (laxmikant-gurnalkar) wrote :

 I had processed big data manually in unsaved document and I was about to paste that copied data to actual template. machine crashed. lost my 3-hours of work.

Revision history for this message
Xtina Schelin (xtina-schelin) wrote :

TextWrangler on the Mac autosaves unsaved documents and the entire session. Notepad++ on Windows does this as well, albeit with some configuring. Looking forward to gedit getting with the times.

Changed in gedit:
status: New → Invalid
Changed in gedit:
importance: Low → Unknown
status: Invalid → Unknown
Changed in gedit:
importance: Unknown → Wishlist
status: Unknown → Confirmed
Revision history for this message
Vance Morris (vmorris) wrote :

Please implement this... I use gedit all the time and it's pretty damn annoying that this feature hasn't been added yet.

Revision history for this message
tom (tombuntus) wrote :

Yeah, wtf. So simple, and so valuable. Why oh why hasn't this been tackled in 6 or 7 years since it was noticed!?!?!

Revision history for this message
Jason C. McDonald (codemouse92) wrote :

I dug into the code to try and fix this, but it's a lot more complex than it looks. If anyone wants to start digging, look at `gedit-tab.c:248` - that's the first catch conditional. Also look at the function getting called if that conditional passes - there's a similar catch conditional in there.

The main problem is that auto-save pulls in the file object, which doesn't exist if the document is unsaved. Autosave would actually have to save the file to some special "temporary" directory. Easier said than done.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.