Linux – Non-blocking editing of remote files via SSH

linuxmacossshsublime-text-2sublime-text-3

On OS X, I frequently need to edit files that are actually stored on a remote Linux server I connect to via SSH over VPN. When I'm at the physical of the location of the server, I can easily mount the directory of those files via sshfs and drag them into Sublime Text. Reading and writing files will be almost instantaneous.

However, when I'm mounting the directory via sshfs on FUSE for OS X, loading the directory listings takes forever, and when I pull the entire directory into Sublime Text, then save a file, saving is blocking the entire UI until the file is finally saved on the server.*

I also tried opening the directory in Cyberduck and editing files from there. While the saving works nicely (because it's asynchronous), this has two drawbacks: I can only open a few files at once—not entire folders—and therefore cannot search files easily (like CmdT in Sublime). Also, sometimes it loses the connection and then I have to quit and restart Cyberduck to make it work again.

Is there any way to edit files from a remote machine in a non-blocking manner? Maybe through tweaking sshfs? Mounting the files differently?

What I'd really like is for the file to be transmitted in the background when I save it, without having the filesystem wait.

* This seems to be a known problem with Sublime Text, but I cannot use any other editor, really. I posted the issue on their forums as well.

Best Answer

  • If you haven't tried it already, I highly recommend Transmit. I haven't done direct head-to-head tests, but I was having a lot of issues using various FUSE options, and they've pretty much disappeared since I started using Transmit. It's got a great UI, including a little toolbar helper that allows you to mount shares as an OS X volume easily without starting the full program. You can try before you buy, but for me it was a no-brainer to buy. Yes, occasionally things are a little slow, but personally I think that for me it has more to do with some underlying issues I have with OS X than anything to do with Transmit itself.

    If you're a registered user, you can try the latest build of Sublime Text 3 to see if that improves anything. Another option you can try is setting

    "atomic_save": false
    

    in your user preferences (Sublime Text -> Preferences -> Settings - User) so you're just performing a single save action over the SSH connection, instead of a save and move. Please note that this is a Sublime Text 3-specific feature.

    Finally, if you feel like generating a thorough bug report, please open an issue on the unofficial bug tracker at GitHub/SublimeText/Issues. This is a community-supported resource that may or may not be consulted by Jon Skinner, the ST author, but it's a single place to file bugs and allows for much better tracking than the forums.