I lost open tabs and probably, files! HELP!



  • Hello. Im always work with open tabs(non saved docs, or pasted text in), or txts with unsaved changes, BUT today when I computer shutdown (several mins ago) Notepad plus ask me save some file because no exists att disk)(which never happens before!) , I say YES and GOT only new1 tab !!! ALL GONE!
    Any help? Pleaseeeeee.



  • welcome to the notepad++ community, @Vlad-Gordiy

    you could look in %AppData%\Notepad++\backup if anything is left, but otherwise you’re out of luck.

    a shutdown will only halt as long as a dialogue window is open.
    as soon as the dialogue is closed, and the timeout for a graceful shutdown has passed, the windows shutdown process will force kill any running application.
    this does not give applications time to save their current state, like the notepad++ session.

    if you use unsaved tabs or files:

    • make sure you don’t shutdown or reboot your pc, while notepad++ is still running.

    • make sure you disable automatic windows update reboot, if you leave notepad++, or any other application, running while you are absent from your pc.

    • make sure you don’t need the unsaved tabs in the future, as a power loss, without an ups or battery pack, will eventually produce data loss or data corruption.



    1. Yes, Im have file right here. How do I can restore tabs back and edited files too?

    2. Always I shutdown this way - click shutdown botton in Windows. And Notepad ++ automtically restore with all tabs and edited unsaved files, after I turn my coputer on! But today, somthing goes wrong and notepad doesnt restore anything! wtf



  • @Vlad-Gordiy

    Yes, Im have file right here. How do I can restore tabs back and edited files too?

    your backup files will look like this:
    unsaved tabs: new 1@2019-03-20_043157 (tab name, followed by @ and date + time)
    unsaved files: yourfile.txt@2019-03-22_083021 (file name, followed by @ and a date/time stamp)

    • first copy them all to a new folder on your desktop.
    • for unsaved files, rename your backup copy to the original file name, by removing the @ and the date/time stamp.
    • for unsaved tabs, rename your backup copy to the original file name, by removing the @ and the date/time stamp, and add the extension .txt as they don’t have an extension yet.
    • open all files in notepad++ and check if you are lucky and they reflect your unsaved files and/or tabs.


  • @Vlad-Gordiy

    Did you learn any kind of lesson from this experience?



  • Im always think Notepad++ always save last opened tabs as Firefox or CHrome always do



  • @Meta-Chuh said:

    @Vlad-Gordiy

    Yes, Im have file right here. How do I can restore tabs back and edited files too?

    your backup files will look like this:
    unsaved tabs: new 1@2019-03-20_043157 (tab name, followed by @ and date + time)
    unsaved files: yourfile.txt@2019-03-22_083021 (file name, followed by @ and a date/time stamp)

    • first copy them all to a new folder on your desktop.
    • for unsaved files, rename your backup copy to the original file name, by removing the @ and the date/time stamp.
    • for unsaved tabs, rename your backup copy to the original file name, by removing the @ and the date/time stamp, and add the extension .txt as they don’t have an extension yet.
    • open all files in notepad++ and check if you are lucky and they reflect your unsaved files and/or tabs.

    why you forgot mention session.xml in notepad++ appdata folder? I just make copy this file and replace wiped folder, and after restart porgrams N++ restore all tabs with all files and scrolls saved!



  • @Vlad-Gordiy

    congratulations, if i understood everything correctly, you have been able to successfully recover your unsaved tabs and files. 👍



  • Thanks for your help, really appreciate it! :-)



  • Back to the same old way of operating!



  • @Meta-Chuh said:

    make sure you don’t shutdown or reboot your pc, while notepad++ is still running.

    And what if the power fails? I always reboot with NPP running and never lost any tabs until version 7.6.3. So I thought it would always recover a session, like Firefox or Microsoft Word… What a surprise when everything disappeared !

    a shutdown will only halt as long as a dialogue window is open.

    …but Windows Notepad halts shutdown even when a dialogue window is NOT open! – NPP should work the same way, as the user expects. (Also, NPP does not implement file locking on the contents of its own temp folder while it is running!?)

    if i understood everything correctly, you have been able to successfully recover your unsaved tabs and files.

    If I understood correctly, it also means that automatic session recovery should be trivial to implement in source with a “clean shutdown” flag and a backup of session.xml


    @Alan-Kilborn said:

    Did you learn any kind of lesson from this experience?

    I think the lesson is for the developers.

    Back to the same old way of operating!

    Which should be supported ! 😁



  • @kekukui said:

    And what if the power fails?

    I think the lesson is for the developers.

    You can’t be serious…If a tornado/hurricane comes to your house and smashes your computer and its hard drive into bits and your data is lost…is that something the developers should protect you from?

    Save (ctrl+s, often)…and backup (independently of Notepad++, move copy offsite, also often).



  • What needs to happen to get the old functionality where tabs/files persisted across reboots?

    I’ve been using the notepad++ as a persistent sticky pad for snippets of code, error messages and random state for years. The old behavior was incredibly useful. Do I need to make a fork?



  • @Douglas-Dike said:

    The old behavior was incredibly useful

    And the persist-across-exits-or-reboots behavior still exists. It is now, and has always been, a calculated risk on your part to enable it. If you lose data (as the OP of this thread did) because Windows crashed, don’t blame Notepad++; anyone relying on an auto-save to not be corrupted during OS crash is taking the consequences of their own decision: it’s not a danger specific to Notepad++: I’ve lost data because MS Word auto-save feature corrupted both the original file and the periodic auto-backup. I always recommend taking full control of critical data (“save early, save often; commit early, commit often” is my mantra).

    And that behavior is now, and has always been (*) enabled via the Settings > Preferences > Backup > Enable Session Snapshot and periodic backup.

    (*: “always” may be an overstatement. I doubt the feature existed in Notepad++ before Notepad++ existed; I don’t know what version number Notepad++ added the session-snapshot/periodic-backup feature. But as long as I’ve known about that feature, it’s been at that setting.)



  • welcome to the notepad++ community, @Douglas-Dike

    What needs to happen to get the old functionality where tabs/files persisted across reboots?

    this code part has not changed.
    what has changed, is that you are probably on windows 10, or worse: on w10 build 1809, which will currently force kill applications on automatic windows update reboots, with a more limited grace period, for a “better microsoft user experience” due to faster rebooting.

    Do I need to make a fork?

    no, you just have to install any of the older versions, which you think worked before, from here:
    https://notepad-plus-plus.org/download/all-versions.html
    to personally verify that notepad++ has not changed regarding “tabs/files persisting across reboots”, but your windows platform it is running on.

    eventually you could also dig out your good old win7 dvd and “repair” win10 with it ;-)


Log in to reply