If I'm editing file mounting in directory via sshfs I'm don't save it. I have to copy it to the local system, edit it here, and then copy it back.
Do you have atomic file saving selected? If so it requires rename over existing file to work, which may not be the case over SSHFS by default, see http://unix.stackexchange.com/questions/123231/what-does-sshfs-oworkaround-r...
There is something broken with sshfs and Geany 1.30.1 on GNOME 3.22.3 (using it on Fedora 25). When mounting a folder in Nautilus via the usual sftp://yourname@yourIP/home/somename, doubleclicking in any pyhon file or script opens Geany on the selected file as usual but the file content is empty.
Moreover, if saving by mistake , all the file contents get LOST!, the original file is overwritten by Geany with a zero-length file.
If launching geany and then using File > Open to navigate to the sftp folder and select a file (e.g. a pythong script), the Geany errors out and does NOT load the file, the error displayed is:
"/run/user/1000/gvfs/sftp:host=x.x.x.x,user=yourname/home/kodi/scriptname.py" was not found
Looks like there is a problem in the "user" attribute of the URI.
I have uses sftp mounts with Geany for many years without a problem.
If this is a Geany bug I would qualify it as Major or Critical since people can easily loose code if not aware
@arigit Geany hasn't changed, so it sounds like Fedora has. It sounds like it does not keep the SFTP mount open after Nautilus has mounted it? First thing to look at is the release notes on Fedora for Nautilus, SFTP and general and see what is listed as changed.
I am not aware of any of the Geany contributors using Fedora and SFTP so you probably will have to do the evaluation.
Could be a gnome library (gio?) rather than fedora or nautilus. Geany's File Open dialog can browse the sftp mount and select the file, but then it fails to load it. Nautilus is not involved in this flow.
Other apps such as gedit and gnome-builder work fine with the mount, either via their File Open dialogs or by launching the with "Open With" from Nautilus.
I opened a bug with Fedora too, for reference:
https://bugzilla.redhat.com/show_bug.cgi?id=1462544
What GTK and Glib versions are you using? (see Geany `menu->help->debug messages` near the top).
You can turn gio file operations off in `edit->preferences->various->use_gio_unsafe_file_saving` which despite the name also turns off GIO reading.
Geany then uses the Glib `g_file_get_contents()` and `g_file_set_contents()` which don't use GIO unless its changed.
You can also turn off the `g_file_set_contents()` (which does a rename and other stuff, see my post above) and just use C output by `edit->preferences->various->use_atomic_file_saving`.
19:03:27: Geany INFO : Geany 1.30.1, en_CA.utf8 19:03:27: Geany INFO : GTK 3.22.15, GLib 2.50.3
I tried changing use_gio_unsafe_file_saving to off and it worked.
Then I set it back to on, and it still works. Opening files from sftp mounts directly inside geany works, and also in nautilus Open With geany works. I can no longer reproduce the problem; it's weird because my desktop workstation was not rebooted since yesterday when I opened this
So I guess I should close this issue for now, or wait a bit and see if I manage to find the way to reproduce the problem.
In version 1.33 save file via sshfs on openssh 7.6p1 work fine.
Closed #1437.
github-comments@lists.geany.org