Saturday, April 15, 2023

An easier way to edit remote files

 


My main development machine at work is an Ubuntu desktop machine which I've got set up with cross compilers and a number of other development tools.  It's reasonably fast but because it runs Linux, it can only be connected to our lab network at work.  This used to mean having to ssh into the machine to edit files which on a fast network with X11 forwarding means I can use a GUI editor.  However I've been noticing a maddening amount of network lag between our lab network and the corporate network which means I end up waiting several seconds for things like cursor movement to take place.  That can break my train of thought.

Fortunately I discovered that WinScp has the ability to not only transfer files between systems but it can also allow me to edit files on those systems.  I launch WinScp, tell it to connect to my development machines, navigate the the appropriate directory, right click on the file I want to edit, and select launch external editor.  It can be configured to use your choice of editors on the Windows machine where WinScp is running.

Once you make the request, WinScp transfers the file to your local machine and launches your editor of choice.  Once you're done editing, it transfers the updated file back to the remote system.  The actual editing all takes place on your local Windows machine so it prevents network lag from causing a painfully slow editing session.

No comments: