randy3k / RemoteSubl

Use rmate with Sublime Text, an improved fork of rsub.
331 stars 20 forks source link

rsub not resuming after broken ssh connection #22

Open mxndrwgrdnr opened 3 years ago

mxndrwgrdnr commented 3 years ago

I have an .ssh config that looks like this:

Host ec2-x-x-x-x.us-east-2.compute.amazonaws.com
    RemoteForward 52698 127.0.0.1:52698

Host *
    ServerAliveInterval 20

Sometimes my connection to that aws machine fails, after which any changes I make to my open files in sublime no longer get pushed to remote. No error message in sublime, I can still "save" my files locally, but the changes don't get synced to the remote versions and as best I can tell there's no way to "refresh" the open files to re-establish that connection without closing each open file and re-opening it using the rsub command from the remote terminal.

Any suggestions?

randy3k commented 3 years ago

You don't have to close the file, just resume the ssh connection and run rsub command will bring the connection back.

mxndrwgrdnr commented 3 years ago

Thanks for the response. What happens if I have unsaved changes in my file when the session drops? If I resume the connection and run rsub on the remote, won't it reload the remote copy and squash my local changes?

randy3k commented 3 years ago

I may be wrong, but I guess the following will happen. The remote copy is saved to the same temp file and Sublime Text will prompt to you that the file has been modified and ask to see if you want to load the changes.