Avoid VS Code Remote having to reload window after Mac goes to sleep
Asked Answered
F

1

10

When connected to a remote SSH host and my Mac goes to sleep after a few minutes of inactivity, I have to reload the whole window to re-establish a connection when I return.

reload-prompt

What's the least energy-inefficient way of avoiding this wait-time whenever the connection was cut due to inactivity? Is there a way to keep the session active (or reconnect to it more smoothly without having to reload the whole window) without disabling sleep mode on my Mac entirely? If not, is there a way to automatically disable sleep mode only when a VS Code remote session is active?

Fyrd answered 9/11, 2020 at 10:1 Comment(0)
E
3

For me, this wasn't specific to VSCode. Rather, it was a general problem with using ssh from a Mac. You may find this helpful https://apple.stackexchange.com/a/251244

In particular, adding

host your.remote.host
     ServerAliveInterval 180

to your ~/.ssh/config

Enenstein answered 5/4, 2022 at 8:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.