I had a Thunar(file manager) that lets you make custom actions on whatever file is highlighted.
I had a custom action meant to only open text files using Geany.
I accidentally click on a 3.9 Gb .iso file. :slight_smile:
Using Mate System Monitor, I saw that my action caused the resources to get to around 80% when I did a reboot.
I wonder if Geany could be written so it checks first if it is a text file?
Geany does not edit anything but text files, and it _does_ check that the file is text (UTF-8), so it has to read the file, thats 3.9Gb gone just to start with ;-). But since most files do not indicate their encoding, it is also necessary to check if there is an encoding that might convert to text successfully, and that can use an unknown multiple of the file size as Geany tries each encoding it knows.
There have been various requests to not do slow/expensive things on large files, but nobody has ever identified a sensible way of determining a limit, a memory/CPU limit on a 64Gb workstation might not be appropriate on a 4Gb Raspberry Pi. So it comes down to Geany will do what its told, so don't tell it to do "bad" things.
Thanks.
My post was not a criticism. I love Geany.
My solution was to put in a check to "get me to thinking first."
This is a Thunar custom action. ` pkexec geany %f`
Anything in Geany that slows you down and "gets you thinking" will have the same effect on all other users who will likely be annoyed by the delay/thinking that they don't (think they) need. Perhaps you could have Thunar run a script with the required behaviour and after being satisfied the script can then run Geany. Such script is left as an exercise for the reader.
Closed #3965 as resolved.
Thunar has options to allow it to only act on text files which I availed myself of.
github-comments@lists.geany.org