SUMMARY When Kate asks the changes to be saved on exit, clicking "Discard" will not discard the changes STEPS TO REPRODUCE 1. Uncheck/Disable the the following option in Kate config: Session -> Automatically save and restore: [ ] Files with unsaved changes 2. Open an existing file in Kate 3. Make changes to the file 4. To track the changes, Kate creates *.kate-swp (next to the file), which is fine 5. Close Kate 6. Kate asks if you want to save the changes to the file. Now click "Discard" 8. Start Kate again OBSERVED RESULT Kate now complains that the file was not closed properly, and asks if I want to recover the data. (I assume this is because Kate did not delete *.kate-swp when I clicked "Discard") EXPECTED RESULT Kate should not report that the file was not closed properly, because it should have discarded my changes to the file (I assume Kate should delete *.kate-swp when I clicked "Discard") SOFTWARE/OS VERSIONS KDE Frameworks Version: 6.9.0 Qt Version: 6.8.1
Hmmm, that seems strange, could you check if Kate did crash on shutdown?
It seems that kate closes gracefully when I click "Discard". I don't see any traces of crash in the logs. $ journalctl --since "1 min ago" | grep -i kate Jan 12 11:28:09 vivo kate[11964]: kate.time: QApplication initialized in 80 ms Jan 12 11:28:09 vivo kate[11964]: libkate.time: -> katefiletreeplugin load in 1 ms Jan 12 11:28:09 vivo kate[11964]: libkate.time: -> katesearchplugin load in 4 ms Jan 12 11:28:09 vivo kate[11964]: libkate.time: -> kateprojectplugin load in 0 ms Jan 12 11:28:09 vivo kate[11964]: libkate.time: -> externaltoolsplugin load in 0 ms Jan 12 11:28:09 vivo kate[11964]: libkate.time: -> katekonsoleplugin load in 0 ms Jan 12 11:28:09 vivo kate[11964]: libkate.time: -> lspclientplugin load in 2 ms Jan 12 11:28:09 vivo kate[11964]: libkate.time: -> tabswitcherplugin load in 0 ms Jan 12 11:28:09 vivo kate[11964]: libkate.time: -> textfilterplugin load in 0 ms Jan 12 11:28:09 vivo kate[11964]: libkate.time: All plugins loaded in 10 ms Jan 12 11:28:09 vivo kate[11964]: libkate.time: Created KateMainWindow in 55 ms Jan 12 11:28:09 vivo kate[11964]: kate.time: KateApp initialized in 124 ms Jan 12 11:28:33 vivo systemd[1103]: Started Kate - Advanced Text Editor. Jan 12 11:28:33 vivo kate[12019]: kate.time: QApplication initialized in 76 ms Jan 12 11:28:33 vivo kate[12019]: libkate.time: -> katefiletreeplugin load in 1 ms Jan 12 11:28:33 vivo kate[12019]: libkate.time: -> katesearchplugin load in 4 ms Jan 12 11:28:33 vivo kate[12019]: libkate.time: -> kateprojectplugin load in 0 ms Jan 12 11:28:33 vivo kate[12019]: libkate.time: -> externaltoolsplugin load in 0 ms Jan 12 11:28:33 vivo kate[12019]: libkate.time: -> katekonsoleplugin load in 0 ms Jan 12 11:28:33 vivo kate[12019]: libkate.time: -> lspclientplugin load in 2 ms Jan 12 11:28:33 vivo kate[12019]: libkate.time: -> tabswitcherplugin load in 0 ms Jan 12 11:28:33 vivo kate[12019]: libkate.time: -> textfilterplugin load in 0 ms Jan 12 11:28:33 vivo kate[12019]: libkate.time: All plugins loaded in 11 ms Jan 12 11:28:33 vivo kate[12019]: libkate.time: Created KateMainWindow in 55 ms Jan 12 11:28:33 vivo kate[12019]: kate.time: KateApp initialized in 111 ms Jan 12 11:28:42 vivo systemd[1103]: app-org.kde.kate@31cc4d0b96734b45a0639d05bef1313e.service: Consumed 392ms CPU time, 68.4M memory peak.
Hi - I can't reproduce using those steps on Kate 24.12.1, Fedora KDE 41. I wonder if, perhaps, some other session-related setting is interacting with the one you specified? The settings I have that are nearby in the Configure Kate > Session dialog are below - could you please share yours to double-check? Application Startup Behavior: Manually choose a session Automatically save and restore: Newly-created unsaved files (yes), Files with unsaved changes (no) Show welcome view for new windows: Yes Close the application entirely when the last file is closed: No Close documents with the window they belong to: Yes
I've updated Kate to v24.12.1 and I'm still having this issue My settings are almost the opposite of what you have though: Application Startup Behavior: Load last used session Automatically save and restore: Newly-created unsaved files (no), Files with unsaved changes (no) Show welcome view for new windows: No Close the application entirely when the last file is closed: Yes Close documents with the window they belong to: Yes
Btw I've just retested with your settings above, and I'm still seing the issue, so it must be something else
Also just to emphasize: There is no issue when I close the tab of the unsaved file. Clicking "Discard" in that case works as expected. I'm facing the issue only when I close the whole application while the file is still unsaved.
(In reply to Filip from comment #6) > Also just to emphasize: There is no issue when I close the tab of the > unsaved file. Clicking "Discard" in that case works as expected. I'm facing > the issue only when I close the whole application while the file is still > unsaved. Yep, that's how I closed it as well - and I tried changing my Session settings to yours, and still couldn't reproduce it - so indeed, something else is going on!
I also reset my kate settings to default (by removing $HOME/.config/katerc), which did not fix the issue either. I was thinking that maybe there is some sort of race condition that makes kate close before it could remove the kate-swp file. But then the issue should also be present when I click "Save" on exit. However in that case, kate (saves the edited file and) removes the kate-swp file with no issues. So I'm now out of ideas what could cause this.