When I reboot the system - geany loses the list of open files, how to fix it? System Kubuntu 12, and 14, and 16 - The same behavior.
Loses the list or doesn't save the latest version?
In my experience Geany closes without saving the list when it receives SIGINT.
To keep the list you need to use **File->Quit** after opening a new file or close and re-open the project.
Ideally this would be fixed
If you close geany in the manual - it retains. It is not very convenient! Other editors such oddities are not. Is it possible to do save project every time you open a new file?
Crashing Geany is not the correct way to close it. (Crashing it is what your system is doing to Geany if you logout or shutdown with Geany still running).
Even if the session was saved each time it was saved, its only one of the things that can be saved at shutdown, many plugins (which are made by people outside the Geany team) only save at shutdown.
Duplicate of #1416
I don't know what signals your OS is sending to Geany, but if it's not sending `SIGTERM` Geany won't even try to save the session. We could probably add other signals to be handled if it makes sense (mentioned in the comments on #1255).
The problem is that many DEs won't wait, even if they send SIGTERM they don't allow any time for the save to happen before they SIGKILL the process.
Which desktop environments don't have a session manager?
As far as Geany is concerned, all of them :)
But realistically all of the major Linux DEs/WMs do.
systemd (opposed to upstart in earlier Ubuntu verions) additionally sends SIGHUP on shutdown (and waits 90s instead of 10s before sending SIGKILL). I suggest to ignore SIGHUP or to handle SIGTERM and SIGHUP the same (idempotent) way.
[source](https://askubuntu.com/questions/819730/no-sigterm-before-sigkill-shutdown-wi...)
I modified Geany to ignore SIGHUP, but when I sent SIGTERM geany opened a dialog asking if I really wanted to quit
The behavior is the same on all kubuntu 12, 14, 16 versions. Geany crashes or not - I don't know. To save the list of open files in the project I specifically restart geany, every time you open or close files. If this is not done, then after the computer is restarted - the project list is not correct, consistently Repeated since 2010 !
@codebrainz maybe there are too many negatives in it but what I meant is that Geany does not subscribe to any of the session managers, so effectively as far as Geany is concerned no DEs have session management.
Why not add the function to save list of projects each time you open or close files. Can it be done optional?
@RostislavVel sure, just "somebody" has to do it.
@elextr I did not understand your answer?
Saving the session (in project or user files) whenever files are opened or closed is possible, just that somebody has to contribute the code to do it, preferably with an option, since not everyone will want to hit the project/user file on every file open/close.
I'm a user, not a developer Geany. I wrote to support asking to resolve it sometime in the near future! I have Geany installed from a package and have no desire to build it from source.
@RostislavVel thats fine, but Geany is a volunteer project, it is not run by a company, it has no paid developers, so things only happen when somebody contributes the code.
So what I am saying is, yes its possible and even reasonable (IMO) to save the session on file open/close, but somebody has to contribute it, and they should ensure it has an option since not everybody will want to use the facility.
Who can tell the place in code where I can add, and how do these changes contribute to the overall project?
That would be in the future to get the official version of the package with the same functionality.
While the program is still running is there a file somewhere that contains a list of the files open? If so, could I later somehow manually inject that list into the startup?
If I could even just copy a particular folder or file, that would be good enough. I occasionally lose my list of what I had open and when I run geany again it opens a different list of files..
Ok, I wrote a small script to generate document list every 5 minutes and keep the last 49 of them [save_geany_files.zip](https://github.com/geany/geany/files/6911919/save_geany_files.zip)
@cheapy the PR #2114 listed above saves the session whenever it changes, so with 1.37 or newer you shouldn't need to do anything.
This probably should have been closed when #2114 was merged.
Closed #1826.
I will have to wait till I switch to bullseye, it looks. I wasn't able to get past the dependency issues to install a 1.37.1 on my buster based system. I was able to build it from Git, but it gave me an error about missing Glade setup, so since bullseye is close, the easy answer is just to wait for it.
I'm sorry for not figuring out that the capability was added, and appreciate the effort of those who made it happen.
github-comments@lists.geany.org