SUMMARY I have turned on restoring session, and as I mentioned in subject, amount of files increasing at every restoring of session. Since January 17th (this year) just 876 files were collected in folder ~/.config/session. Is it possible to clean this folder automatically, and left only necessary files. I don't know if this should be handled by Plasma maintainer in my distribution or should be done on Plasma side (plasmashell). STEPS TO REPRODUCE 1. turn on restore session 2. run couple applications 3. log out 4. log in Repeat last two steps several time. OBSERVED RESULT Increasing amount of files in ~/.config/session folder EXPECTED RESULT Folder ~/.config/session should contain only necessary files and not all including historical files, which will be probably never used in the future. SOFTWARE/OS VERSIONS Linux/KDE Plasma: YES (available in About System) KDE Plasma Version: 5.15.5 KDE Frameworks Version: 5.58.0 Qt Version: 5.12.3 ADDITIONAL INFORMATION
I reported this issue in Bug 384392, but seems has not been considered and bug report just closed, because mainly was related with restoring session not working properly.
Please investigate which files. It could be an app doesn't correctly supply a cleanup script at which point the fault lies with that app.
Created attachment 120741 [details] list of session files
In attachment list of all files which were created since January 17th (this year). On list you can find: dolphin kate kdevelop kmix konsole kwin kwrite okular where only kdevelop appears twice, other occur many times more. This happened before fixing issue related with incorrectly restoration of session and happens still after this fix.
Sorry not only kdevelop, but also kwin seems to be correctly created and removed. For kate are quite old files, obviously because I closed it one day and after alternatively next start it didn't stay till end of session.
At June 10th I removed all files from ~/.config/session. Passed couple days. Today I checked this folder I can see that files multiplying for: dolphin, kmix, konsole, kwrite, okular. I didn't check more than I sent in original post. For kdevelop, kate, kwin seems to handle these files works correctly, because I can see only single file for each of them.
New information was added; changing status for inspection.
Changing status.
*** Bug 404236 has been marked as a duplicate of this bug. ***
I have the same in Fedora 31/32.
Issue still persists. I have 2106 files in directory and I open (almost every day couple applications).
I have had this issue for some time on Fedora. The file .config/ksmserverrc seems to have entries for commands that indicate that old session files should be deleted.
(In reply to Brian Kaye from comment #12) > I have had this issue for some time on Fedora. The file .config/ksmserverrc > seems to have entries for commands that indicate that old session files > should be deleted. I experience this issue till today. Could you please tell us which commands needs to add to config/ksmserverrc file that old session files would be deleted?
I have not deleted files in .config/session for some time. It appears that instances for some files have disappeared. The only one that continues to be added if for systemsettings. I will delete all the files in .config/session today and see what happens.
I did a restart twice and files were retained for twice for systemsettings, kcalc, dolphin, several console sessions, and kpat. These are the ones that were open at the time so I am not sure what other commands are affected. I can understand that it would be wise to keep one copy in case of a system crash.
I did update to Fedora 38 yesterday.
Upon further reflection, I wondered it if someone might want to migrate back to an old session for whatever reason. The system could optionally keep a certain number of old session information and the user could be presented with an option of which one to restore. Perhaps a timer to use the last session configuration like grub2 does on boot and an option to keep old session or not.
The problem persists in Fedora 39 with plasma-desktop-5.27.9-1.fc39.x86_64. I have 781 files in .config/session.
(In reply to Brian Kaye from comment #17) > Upon further reflection, I wondered it if someone might want to migrate back > to an old session for whatever reason. The system could optionally keep a > certain number of old session information and the user could be presented > with an option of which one to restore. Perhaps a timer to use the last > session configuration like grub2 does on boot and an option to keep old > session or not. JFTR: The session files for stopped activities are stored in .config/session, too. So deleting everything in this directory for some kind of clean-up is no good idea if someone makes use of the activity feature (like I do, heavily). But the file counter increases even more for activity users: My .config/session folder contains 23215 files at the time being. That is way too much, even with activities kept in mind.
I agree that there are situations where keeping old session configs might be useful. I suggest there should be some option to decide how many to retain including all of them an give the use the option of which one to activate.
Just checked today there were only two files in .config/session. Wonder if the problem is fixed or moved to another location. System is running Fedora 41.