Ok I implemented a wrapper around xdg-open as you suggested and it works perfectly fine!
It’s not as smooth as vanilla and it’s opening the editor in a separate window of course but it really fine.
Thank you very much everyone for your help, I really appreciate!
Just to summarized everything:
- Use homeishome-launch to make Go use the right home directory
- Use
xdg-opento edit the files (add add thedesktopinterface) - Write a wrapper around
xdg-opento wait for the user to finish editing a file - Make
$TMPDIRpoint to$SNAP_USER_DATAto allowxdg-opento access temp files