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
guard documents during saving against IO errors, application crashes and power loss ("bad" write: open file handle (file is truncated to 0 bytes) --> crash --> new content would be written)
create regular backups from changed files to prevent lost during power loss or shutdown
... controlled via settings.
What problem does this feature solve? [optional]
Lost of documents and changes when Mark Text is terminated. This issue should be implemented together with a session to save the latest workspace (tabs, view state, etc).
Reacted by Keito Tobichi, Isaiah Odhner, rhzone, Stephen Karl Larroque, Dae, gecko, firai, YalandHong, TY, yflag and 7 more
I understand that you need a historical version of the file. We regularly help the user keep a historical version of the edited text, for recovery after file loss and rollback to the historical version?
I have also considered this feature, including some of its ancillary features, we can choose the historical version when rolling back, including the historical version created time, preview, and the diff contrast with the latest version (if there is the latest version), in the storage history In the version, we also need to delete the old historical version regularly to save memory. For example, we may save it in 3 minutes in the recent editing. The old history may be one version per day or per month.
I thought about a simple session and recovery feature such as in vscode or Firefox. More specifically that we save the session and files (tabs) regularly and make Mark Text single instance. Then we can run a thread (or process via electron-remote because node doesn't support threads) to regularly (user-defined - lets say 60s) write changed tabs to the backup location and overwrite the old backup. Session changes should be written into a state, which is saved before the application is closing and regularly via the "recovery" thread. After a forced restart we can restore all tabs or notify the user about the problem. A forced restart can be detected for example in case a recovery file exists in the backup location. While the application is closing we remove this file and delete old backups in the background.
The state of various window, tab and user-data will be saved, and reloaded upon application start. The feature will be passive, reacting only to forced-restarts such as extension installation and crashes. [...]
Features
Save data for each window and tab (P1)
Automatically restore the session data upon restarting from a forced closure (P1)
If post-crash, allow the user to choose whether to restore (P1)
Allow the user to "undo" closing a tab or window (P2)
Please implement this feature, it's very critical. It's not a feature most people see at first, but when they need it, this is what will make them either migrate to another app (whether it provides more security or not), or stick and love this app.
I can't help in programming, but I can suggest to take inspiration from Notepad++, which has the most reliable session and autosave feature I have ever seen, it's highly robust, I have never lost any file with it. In fact, I everyday just close Notepad++ with it being full of unsaved documents/tabs, and I reopen the next day without any loss, and I do this for weeks/months. A nice feature is that it's possible to specify where the unsaved documents are stored, which I have pointed to a folder that I automatically back up on the cloud with SpiderOak. So even if Notepad++ fails (which has never happened yet), it's improbable I'll lose any document. That's the kind of flexibility their implementation allows, and it simply relies on autosaving regularly unsaved documents wherever the user points to.
Reacted by firai, atztao, Nicolas, Austin Gilbert, Nemanja Ilic, Ishaan Shrivastava and Ar-Kareem
Reacted by Ran Luo, gecko, Kenneth Fuglsang Christensen, atztao, Ishaan Shrivastava and Ar-Kareem
I just lost a huge document and my hope brought me here only to be crushed by the [Open]. Needless to say I would love if this was implemented, and I use Notepad++ the same way that Irq3000 does so something similar would be optimal. But I think that if the app is terminated suddenly then it could try to save a "recovery" file at least and prompt the user on startup if they want to restore it.
Reacted by Toprak Öztürk, Stephen Karl Larroque, sawntoe, Zhao Xuyang and Ishaan Shrivastava
I'm new to this project, so I don't really know how MT works but maybe the file could be auto-saved in a temporal directory (/tmp/...) every X seconds and if it fails, it can use this backed up file as a recovery file.
Reacted by Stephen Karl Larroque, Ishaan Shrivastava and Ar-Kareem
Yes that's exactly what Notepad++ does, to save every X seconds a backup of all opened files/tabs, and that's likely the safest way to provide a file recovery feature as otherwise any mechanism that only activates when the app crashes is: 1) more complex to implement as it requires a different process to run in parallel to the main app and detect when the main app crashed, 2) is prone to also crash or be unable to recover the files in case the crash is due to external circumstances (ie, power outage, OS crash, etc), in which cases only periodic saving can recover the files.
If this gets implemented, I would strongly recommend to allow the user to define what directory to save backups to, this allows to use cloud backup services to add some redundancy or even version history.
Reacted by moshpirit, nahux, Ishaan Shrivastava and Ar-Kareem
Ahhhhhhhhh I just created lots of unsaved untilted tabs, with lots of draft text written and lots of images captured, due to convenience (Cuz there is often the case that fast information recording is needed, such as meeting, remote communication..); Afterwards I just covered my thinkpad and heartbreakingly, it fell into sleep and cannot be awakened any more!!! I have to force to restart it.... And Now the unsaved tabs are allllll lost !!!! 555555555..... I cannot live!!!! So saaaad o(╥﹏╥)o Ahhhhh
So please, I beg you, please offer some functions, such as caching these unsaved documents, or recovering, like that... It's just for the peace of the world!!!!!! for the saving the lives of people like me...
I have just lost my file content and I don't understand why because I saved regularly (event hough MarkText is doing it automatically). It is a lot of work and I really need to know if I can recover it please help !
This would be an amazing feature to have (and a must for me personally to switch to marktext).
I generally have 5-10 documents open at a time filled with content in addition to unnamed new documents not saved to disk yet. Whenever windows decides to be windows and auto-restart the PC for an update, I need to be able to recover my content or I can't justify using the software.
Notepad++ does this very reliably and it would be amazing to also have that reliability here.
Does Marktext have logs like Typora? If I have not turned on autosave and Unexpected shutdown the computer without manually saving, how can I recover the content????????????????
There is Typora, which appeared around the same time as MarkText but has been continually maintained and updated to this day, but it's a paid app. It has auto save and recovesy by the way, as well at autocopy of internet images on copy-pasting, and rendering of diagrams such as mermaid.
Unfortunately it takes a lot of time to work on a note taking editor, so I am not surprised MarkText got dropped at some point.
Furthermore IIRC it is based on electron, which it a dead technology nowadays, so even if someone was willing to continue the project, it would require significant rewriting that probably would make the endeavor meaningless as it would take less time to make from scratch a superior wysiwyg markdown editor using newer technos, especially now that we have AI assisted coding.
The core document and session recovery requested here is now supported on develop (0.24.0-dev, verified at c4b8cdae). This verification applies to the current development build.
Current capabilities:
Recovery snapshots include unsaved changes to existing files and new, untitled documents that have never been saved as .md files. This works with Auto Save disabled.
With Preferences → General → Startup → “Restore all opened files and folders” enabled (startUpAction: restoreAll, the default), launching MarkText normally restores the previous windows, tabs, and document contents. This also allows unfinished drafts to survive normal application exit.
Session snapshots are written after approximately one second of inactivity and flushed before normal window close. They are stored in editorStates under the user data directory. Recovery uses the latest successfully persisted snapshot.
Document saves and session snapshot replacements use atomic writes with file synchronization to protect against interrupted writes.
I verified recovery in the real Electron application on macOS, using a separate profile for each scenario and keeping Auto Save disabled. Every scenario contained two untitled drafts plus an existing file with unsaved edits:
For the forced-termination cases, the automatic snapshot was allowed to reach disk before killing the process. The original .md file remained unchanged, both drafts remained untitled, and all restored documents retained their unsaved status. Restored content was also checked by switching between the tabs. The atomic document-save and session-store unit tests passed as well (6 tests). These checks simulate abrupt process termination, not a physical power outage.
To restore a session, launch MarkText without opening a specific file: opening a file directly follows a different startup path.
Closing this issue as completed for the core document/session recovery request. Thanks to everyone who shared their use cases and reports.
Activity
Jocs commentedon Mar 7, 2019
I understand that you need a historical version of the file. We regularly help the user keep a historical version of the edited text, for recovery after file loss and rollback to the historical version?
Jocs commentedon Mar 7, 2019
I have also considered this feature, including some of its ancillary features, we can choose the historical version when rolling back, including the historical version created time, preview, and the diff contrast with the latest version (if there is the latest version), in the storage history In the version, we also need to delete the old historical version regularly to save memory. For example, we may save it in 3 minutes in the recent editing. The old history may be one version per day or per month.
fxha commentedon Mar 7, 2019
I thought about a simple session and recovery feature such as in vscode or Firefox. More specifically that we save the session and files (tabs) regularly and make Mark Text single instance. Then we can run a thread (or process via
electron-remotebecause node doesn't support threads) to regularly (user-defined - lets say 60s) write changed tabs to the backup location and overwrite the old backup. Session changes should be written into a state, which is saved before the application is closing and regularly via the "recovery" thread. After a forced restart we can restore all tabs or notify the user about the problem. A forced restart can be detected for example in case arecoveryfile exists in the backup location. While the application is closing we remove this file and delete old backups in the background.lrq3000 commentedon Jan 17, 2020
Please implement this feature, it's very critical. It's not a feature most people see at first, but when they need it, this is what will make them either migrate to another app (whether it provides more security or not), or stick and love this app.
I can't help in programming, but I can suggest to take inspiration from Notepad++, which has the most reliable session and autosave feature I have ever seen, it's highly robust, I have never lost any file with it. In fact, I everyday just close Notepad++ with it being full of unsaved documents/tabs, and I reopen the next day without any loss, and I do this for weeks/months. A nice feature is that it's possible to specify where the unsaved documents are stored, which I have pointed to a folder that I automatically back up on the cloud with SpiderOak. So even if Notepad++ fails (which has never happened yet), it's improbable I'll lose any document. That's the kind of flexibility their implementation allows, and it simply relies on autosaving regularly unsaved documents wherever the user points to.
Jocs commentedon Feb 16, 2020
@Irq3000 Very good advice
Jerakin commentedon Oct 2, 2020
I just lost a huge document and my hope brought me here only to be crushed by the [Open]. Needless to say I would love if this was implemented, and I use Notepad++ the same way that Irq3000 does so something similar would be optimal. But I think that if the app is terminated suddenly then it could try to save a "recovery" file at least and prompt the user on startup if they want to restore it.
moshpirit commentedon Feb 23, 2021
I'm new to this project, so I don't really know how MT works but maybe the file could be auto-saved in a temporal directory (/tmp/...) every X seconds and if it fails, it can use this backed up file as a recovery file.
lrq3000 commentedon Feb 23, 2021
Yes that's exactly what Notepad++ does, to save every X seconds a backup of all opened files/tabs, and that's likely the safest way to provide a file recovery feature as otherwise any mechanism that only activates when the app crashes is: 1) more complex to implement as it requires a different process to run in parallel to the main app and detect when the main app crashed, 2) is prone to also crash or be unable to recover the files in case the crash is due to external circumstances (ie, power outage, OS crash, etc), in which cases only periodic saving can recover the files.
If this gets implemented, I would strongly recommend to allow the user to define what directory to save backups to, this allows to use cloud backup services to add some redundancy or even version history.
YFlag commentedon Aug 25, 2022
Ahhhhhhhhh I just created lots of unsaved untilted tabs, with lots of draft text written and lots of images captured, due to convenience (Cuz there is often the case that fast information recording is needed, such as meeting, remote communication..); Afterwards I just covered my thinkpad and heartbreakingly, it fell into sleep and cannot be awakened any more!!! I have to force to restart it.... And Now the unsaved tabs are allllll lost !!!! 555555555..... I cannot live!!!! So saaaad o(╥﹏╥)o Ahhhhh
So please, I beg you, please offer some functions, such as caching these unsaved documents, or recovering, like that... It's just for the peace of the world!!!!!! for the saving the lives of people like me...
vimkim commentedon Oct 20, 2023
just happened... I lost so many things...
Aliwasan commentedon May 6, 2024
I have just lost my file content and I don't understand why because I saved regularly (event hough MarkText is doing it automatically). It is a lot of work and I really need to know if I can recover it please help !
vimkim commentedon Nov 16, 2024
I lost everything and it makes me use vscode again. Please implement this feature.
Ar-Kareem commentedon Nov 19, 2024
This would be an amazing feature to have (and a must for me personally to switch to marktext).
I generally have 5-10 documents open at a time filled with content in addition to unnamed new documents not saved to disk yet. Whenever windows decides to be windows and auto-restart the PC for an update, I need to be able to recover my content or I can't justify using the software.
Notepad++ does this very reliably and it would be amazing to also have that reliability here.
Youngshuang commentedon Feb 6, 2025
Does Marktext have logs like Typora? If I have not turned on autosave and Unexpected shutdown the computer without manually saving, how can I recover the content????????????????
JFWooten4 commentedon Feb 13, 2025
Just happened here for a few hrs of work
DTBtrigger commentedon Feb 22, 2025
No!!! I lost all my content I edited all day.
Please tell me there is a way to recover them. T~T
moshpirit commentedon Feb 22, 2025
I don't think this project is supported anymore, maybe we should start looking for alternatives.
JFWooten4 commentedon Mar 14, 2025
re @moshpirit, do you know what lead to the downtread?
lrq3000 commentedon May 3, 2025
There is Typora, which appeared around the same time as MarkText but has been continually maintained and updated to this day, but it's a paid app. It has auto save and recovesy by the way, as well at autocopy of internet images on copy-pasting, and rendering of diagrams such as mermaid.
Unfortunately it takes a lot of time to work on a note taking editor, so I am not surprised MarkText got dropped at some point.
Furthermore IIRC it is based on electron, which it a dead technology nowadays, so even if someone was willing to continue the project, it would require significant rewriting that probably would make the endeavor meaningless as it would take less time to make from scratch a superior wysiwyg markdown editor using newer technos, especially now that we have AI assisted coding.
memewizards commentedon Jul 16, 2025
why hasn't this been implemented yet? I just lost a week of notes.
Neclyon commentedon Jun 6, 2026
MAMA I JUST LOST A HUNDRED-WORD BLOG
Jocs commentedon Oct 27, 2026
The core document and session recovery requested here is now supported on
develop(0.24.0-dev, verified at c4b8cdae). This verification applies to the current development build.Current capabilities:
.mdfiles. This works with Auto Save disabled.startUpAction: restoreAll, the default), launching MarkText normally restores the previous windows, tabs, and document contents. This also allows unfinished drafts to survive normal application exit.editorStatesunder the user data directory. Recovery uses the latest successfully persisted snapshot.I verified recovery in the real Electron application on macOS, using a separate profile for each scenario and keeping Auto Save disabled. Every scenario contained two untitled drafts plus an existing file with unsaved edits:
SIGKILL), WYSIWYG editingSIGKILL), source-code editingFor the forced-termination cases, the automatic snapshot was allowed to reach disk before killing the process. The original
.mdfile remained unchanged, both drafts remained untitled, and all restored documents retained their unsaved status. Restored content was also checked by switching between the tabs. The atomic document-save and session-store unit tests passed as well (6 tests). These checks simulate abrupt process termination, not a physical power outage.To restore a session, launch MarkText without opening a specific file: opening a file directly follows a different startup path.
Closing this issue as completed for the core document/session recovery request. Thanks to everyone who shared their use cases and reports.