After using Xubuntu (18.04, 20.04) I recently got a new PC and installed Ubuntu 22.04. For some reason some apps just cannot open files in a remote PC mounted via SFTP. Some other apps they just can.
I have found out that the apps suggested in the right click menu are the ones that can open the files. For example in the following right click menu all LibreOffice Writer, Text Editor (gedit) and Zotero) can open remote files:
but Geany and Sublime they can't. The same menu but now on a local file (on local files everything is working perfectly):
If in the remote file I do right click → open with and select Geany or any other app, it fails. The same if I run the command in the terminal:
$ geany sftp://me@remote/home/me_in_remote/file.txt
Could not find file 'sftp://me@remote/home/me_in_remote/file.txt'.
If instead of geany
I use gedit
now it works.
What could be the issue?
Geany does not support opening remote files. I guess this works with gedit, because it is well-integrated with GVFS and automatically mounts the remote directory when you give it a remote file to open.
There should be a workaround, however: with the file browser, navigate to the remote file system first. The file system is then made available transparently in one of the following folders:
~/.gvfs/
or/run/user/$UID/gvfs/
You should then be able to open the remote files from there using any tool, including Geany and Sublime.
From the Geany FAQ:
Mount
sftp://me@remote
and Geany can open a remote file.Your previous install for Xubuntu 20.04 probably mounted the remote location and your current install does not.
TL;DR:
and
solved the problem.
I found out that the remote file system was not being mounted in
/run/user/$UID/gvfs
. After some research I ended up here and that worked.