Closed bersbersbers closed 3 years ago
When I lose connection, I usually get a message from the remote extension itself saying it's retrying the connection, and after a while it will give up and offer to reload the window. Do you get the same thing when this happens, and if so is it automatically reconnecting?
If so, there might be some event I can listen to for knowing when to retry the connection. Otherwise a manual command to restart the connection shouldn't be hard to add, since I already send a message to restart the connection whenever you change SSH settings.
When I lose connection, I usually get a message from the remote extension itself saying it's retrying the connection, and after a while it will give up and offer to reload the window. Do you get the same thing when this happens, and if so is it automatically reconnecting?
Yes, I observe the same thing essentially. Automatic reconnection sometimes works if VPN reconnects fast enough (and I don't remember if I have an X11 problem then), and sometimes doesn't (in which case a VS Code reload fixes everything).
But I observed another X11-only (apparently) disconnect yesterday, where the X11 connection stopped working while my remote connection was working fine otherwise. That was pretty exactly 3h after connecting, so maybe there is a timeout involved. I'll observe this further.
If so, there might be some event I can listen to for knowing when to retry the connection.
Yes. In addition, I might consider using an SSH client with automatic reconnect. Do you think I should be able to use KiTTY's klink.exe
(essentially PuTTY's plink.exe
with reconnect - see https://superuser.com/questions/187293)?
Otherwise a manual command to restart the connection shouldn't be hard to add
That would be great...
since I already send a message to restart the connection whenever you change SSH settings.
... and that sounds like a nice workaround for the short term. Thanks!
I'm using https://github.com/mscdex/ssh2 rather than a separate SSH program, so I'd need to implement the reconnect logic myself, unfortunately.
Ah, I see. Well, they may have a solution already :) https://github.com/mscdex/ssh2/issues/491#issuecomment-258031062 and https://github.com/mscdex/ssh2/issues/491#issuecomment-258047263
Thank you, this is working and helpful!
I seem to have issues with vscode-remote-x11 reinstantiating the background SSH connection after my VPN connection breaks down (12h-disconnect, for example). I am still debugging this, but both for debugging and for handling cases where the remote session is closed for other reasons (see below), a command to reconnect Remote X11 would be very handy.
This is what I get when I deliberately kill the
sshd
process belonging to Remote X11:I would expect Remote X11 to retry the connection by itself in such as case.