Sublime Forum

Any way to recover closed windows?

#1

Hello,

I’m still fairly new to these kinds of editors, and getting to grips with everything, but it seems I may have screwed myself quite a bit here.

I’ve run into an issue just now where I can’t seem to be able to find a way to recover my work.

To start off, I noticed that Sublime was pretty good about autosaving and reloading data from files, even if I had not executed a manual save. In this case, I decided to use it as a ‘scratch pad’ of sorts to note down random ideas I had and such. I also used it to write some code, but because it was all kinds of different things not related to each other, I didn’t think to ‘save’ everything as a ‘Project’ – to me as a new user, I had no idea what implications that had.

With that, while writing my code, I had opened two more windows – these two were ‘projects’ where I loaded everything from specific folders for quick reference using the find-in-all-files feature. I used these to expedite my coding in my ‘main’ window. As far as I can recall, everything worked fine like this because usually, when I went to reboot my PC, I let Windows close everything all at once. Thus, when I reloaded Sublime Text (version 2,) it re-opened all 3 windows automatically. This worked even through crashes, apparently.

However, in my last reboot, I may have screwed myself a bit, as I (without much thought) closed each window manually. I assume that I closed one of my ‘reference’ windows last, because upon reopening Sublime…this project was the only one to load. Have I lost all of my data? Is it possible to somehow salvage and reload the three windows I’ve had open?

Thank you.

1 Like

Recover unsaved files lost because of killed application [OSx]
#2

If you used projects, you can reopen the last state the project was in easily with the ctrl+alt+p project switcher. If not, you’re fucked.

You can make ST “hot_exit” multiple windows with the File > Exit menu item, which will clsoe all windows and reopen them on next run.

0 Likes

#3

This is true, and although there’s really no excuse for complacency here, I sort of did hope that between all of Sublime Text’s ability to autosave stuff, there might have been a way to re-open ‘accidentally’ closed windows (much like the re-open closed tab functionality.) It was a long shot, but it was worth asking as being new to this software, what might be obvious to you may not necessarily be obvious to others. I simply didn’t know the extent of how much it tracked and kept autosaves.

[quote=“FichteFoll”]If you used projects, you can reopen the last state the project was in easily with the ctrl+alt+p project switcher. If not, you’re fucked.

You can make ST “hot_exit” multiple windows with the File > Exit menu item, which will clsoe all windows and reopen them on next run.[/quote]

As I stated in the OP, I unfortunately did not know to create a ‘project’ out of it (because I had no idea what that function was or did.) I did try looking there, but to no avail. I’ll know for the future, though, even if it’s just random files, I’ll simply create a “Random” project to hold all of the unrelated stuff. Thanks, though, on the tip about the hot exit. Didn’t quite know what that was, but it seemed to work as described; navigating to File > Exit instead of pressing the big red X button with multiple windows open does indeed restore all windows when Sublime Text is restarted.

With all that said, I may have actually lucked out and have recovered my work. The issue stems from the fact that my memory of the details from my last reboot were hazy, being that it occurred in the middle of the night. At the time, my GPU crashed somehow, and Windows was unable to update the screen (the UI/Windows would appear, but they were all black boxes which failed to render.) This was the point where I was shutting things down manually in an attempt to find a way to gracefully reboot the PC without a graphical interface.

Having navigated back to my development directory, I’ve noticed a bunch of “unknown” files, which reminded me of exactly what occurred: When I shut down Sublime Text (this particular window I was working on) it popped up a dialogue; Unfortunately, it didn’t render, so it was all black, but I assumed it was the “Do you wish to save?” dialogue, and so I blindly hit ‘Y’ which popped up another dialogue box… also all black, but I assumed it was the Save As window, so I typed unknown1, unknown2, etc. and hit Enter until it stopped popping up messages. It turns out these were exactly the tab contents I am trying to recover. Long story short, I managed to ‘blind save’ all of my files in the working window’s tabs just before shutting everything down. I simply have to reopen everything and rename them into meaningful filenames now.

Either way, I’ll be making some workflow changes, and creating a new ‘project’ workspace for this kind of thing now.

0 Likes