Summary: | Extend Kate's session to stash unsaved documents/changes on quit | ||
---|---|---|---|
Product: | [Applications] kate | Reporter: | Till Schäfer <till2.schaefer> |
Component: | sessions | Assignee: | KWrite Developers <kwrite-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | afief.h, alex.danila.web, boarnoah, bytesmythe, doktor5000, florine, kde, KDE, kubry, linus.kardell, lorenzofsutton, nate, piotr.mierzwinski, samjnaa, thomas, torgato, waqar.17a, yes456, zhx |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | All | ||
Latest Commit: | https://invent.kde.org/utilities/kate/commit/248b061111dffd57ac7879a6fb9abd20098d7441 | Version Fixed In: | 21.04 |
Sentry Crash Report: | |||
Attachments: |
kate_session_configuration-page
kate version |
Description
Till Schäfer
2015-10-07 14:12:20 UTC
This is how Notepad++ behaves. I never have to think about saving files or coming up with names. I can just start a new document (or edit an existing one), start typing, and quit if I need to. When I restart the editor, it automatically reopens all the documents in the same state I left them. I'd love this feature, too. It's especially valuable when Kate or system crashes which happens occasionally. +1 must have *** This bug has been confirmed by popular vote. *** *** Bug 375594 has been marked as a duplicate of this bug. *** *** Bug 352440 has been marked as a duplicate of this bug. *** *** Bug 385275 has been marked as a duplicate of this bug. *** *** Bug 394833 has been marked as a duplicate of this bug. *** A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/228 Git commit 248b061111dffd57ac7879a6fb9abd20098d7441 by Christoph Cullmann, on behalf of Méven Car. Committed on 05/03/2021 at 07:49. Pushed by cullmann into branch 'master'. Allow to stash changes on Close M +1 -0 kate/CMakeLists.txt M +7 -0 kate/katemainwindow.cpp A +97 -0 kate/katestashmanager.cpp [License: LGPL(v2.0)] A +30 -0 kate/katestashmanager.h [License: LGPL(v2.0)] https://invent.kde.org/utilities/kate/commit/248b061111dffd57ac7879a6fb9abd20098d7441 Woohoo, THX! I tested this in Neon updated at Jul, 24th 2021 (details below) and noticed that when I close kate with not saved file then it doesn't ask me for saving this file. So this is what we expected. The same happens when I have in kate not saved file and try to logoff or shutdown the system. Nice. Only the problem is that after kate starts with new session of Plasma, the changes made before closing it are not restored, so nothing was swapped in moment on kate was closed. Second thing is that this (not asking for save not saved file) works only in Kate. When I tried to do the same with kwrite, it asked me for saving file. Please notice that I had the same setting in both. BTW. I have 3 activities, but kate and krwite were tested only on one. Kate 21.11.70 Plasma 5.22.80 Framework 5.85 Qt-5.15.3 Graphics X11 Kernel 5.8.0 I will retest this also with today;s Neon. As I promised, I retested kate in today's Neon. Unfortunately in restored kate changes, which should be stashed wasn't restored. I got original file without any changes made before log out. And kwrite blocks log out, asking for unsaved file. Kate 21.11.70 Plasma 5.22.80 Framework 5.86 Qt-5.15.3 Graphics X11 Kernel 5.11.0-27-generic There are unsaved changes when using Kate 21.08.1 if you open a session, create a new file, write something, wait two minutes and (for example) execute: killall -9 kate Note: No data was lost when I used Kate 21.08.1, I opened a session, wrote something on an existing tab, waited two minutes and executed: killall -9 kate Thanks! Please try with 22.04, a few fixes went into this which should hopefully resolve any remaining issues. If it's not working die you still, first ensure you have a named session and the relevant config enabled (check sessions page in config dialog) Hi, this exactly sounds like what I need, but it does not work like I expect it to. Am I missing something? Here is what I do: 1) Open Kate 2) Create new "Untitled" document 3) Write something into it 4) Wait a bit 5) killall -9 kate 6) Reopen I would expect the "Untitled" document to reappear with it's content. But they reappear empty. I also tried with explicitly opening a session and doing it in that session. Just to be clear, the issue I am fighting is, is data loss on system crash. And I don't want to have to save my quick thoughts each time I have them, to a specific file. This would be annoying. So I have basically the same issue as https://bugs.kde.org/show_bug.cgi?id=375594 which was deemed a duplicate of this. > I would expect the "Untitled" document to reappear with it's content. But they reappear empty. > I also tried with explicitly opening a session and doing it in that session. > Just to be clear, the issue I am fighting is, is data loss on system crash. I would like to add that this doesn't work for me even if I kate is stopped by Plasma and started again with new Plasma session. I have turned on restore session of Plasma and I experience loss data in Kate (for untilted documents) after Kate is restored Please notice I don't have any activities and virtual desktops. This is really annoying. I have turned on proper option in settings of kate. Created attachment 153702 [details]
kate_session_configuration-page
Created attachment 153891 [details]
kate version
I tested this with Kate 23.03.70 and seems doesn't work. In this moment I use Neon Unstable. Crash robustness will require a different changes compared to restoring from a clean quit. Can you please file new bug reports--one per thing, if both are broken for you? In general it's best to open new bug reports rather than re-opening already fixed ones, since the conditions of what you're experiencing can be subtly different from what exactly was fixed. Thanks! (In reply to Nate Graham from comment #21) > Crash robustness will require a different changes compared to restoring from > a clean quit. Can you please file new bug reports--one per thing, if both > are broken for you? In general it's best to open new bug reports rather than > re-opening already fixed ones, since the conditions of what you're > experiencing can be subtly different from what exactly was fixed. Thanks! I opened: Bug 46211 Correction: Bug 462112 I am using Kate 23.08.4 on Manjaro and this doesn't seem to work for me. These are the settings for 'Sessions': https://gcdnb.pbrd.co/images/FtUBw5mWYTrD.png?o=1 I tried starting kate with kate -s and I get an untitled file. I add some text and quit (as expected no warning to save the file). But when I re-start kate the contents of the untitled file is lost. I'd expect the file and session to be saved and then restored based on the above options? I did notice that when quitting for a second there is an orange line on the left highlighting changes ( I have this feature on) but then re-starting the changes are lost. I think either the setting options are misleading or something is not working because the user gets no warning to save the file and this can lead to data loss @Lorenzo I think this is caused by bug #468573. You can find the old files using "Quick Open" (in menu as "Go > Quick Open", or use "Ctrl + Alt + O"). https://invent.kde.org/utilities/kate/-/merge_requests/1578 The untitled doc issue should be fixed now. Please create new bugs for any remaining issues, closing this one. |