OK
Firstly I was inspired by GNUser (currently) private package for tinyopen.
There are some tricks here so forgive me if you already know this.
A You may have a TCE loading in your boot list
B You may TCE loading from ~/X.d (maybe calling a ~/.local/bin file?)
C Manually loading a TCE
current pcmanfm does not refresh your mime types. No-one has noticed
Here is a possible fix.
tce-load -i desktop-file-utils shared-mime-info
sudo update-mime-database /usr/local/share/mime/
sudo update-desktop-database /usr/local/share/applications/
Now because I use various boot lists, I may be my worse enemy here. But I was mislead somewhat by noticing a pesky firefox web browser changing the time stamp and contents of a file I had under .config
It is taken me this long to find the following (YMMV)
-- you do not need local mimeapps.list and related files
If you manually load a TCE and clicking on a file in pcmanfm does not auto open your app,
you repeat above commands,
until I provide an updated install script
or better make a .local/bin by providing a shebang.
so with pcmanfm open.....I loaded feh and mtpaint....and they appeared in my context menu without closing and re-opening pcmanfm
It is still not perfect but for main files like most audio video text files, mime handling appears OK with this fix.
Hope that helps.
PS spacefm has those 2 TCEs either in the dep file or recursive and install script
refreshes those databases.
I have not tested the loading of a package after loading spacefm as this is not about that TCE
but anyone building a new filemanager might like to have a gander at coreplayer2's install script.
Thanks for reading
If you do want to change the order of choices to open a file, then sure you are likely going to need to do a lot more with mime handling. Thats above my payscale ATM