From 384c56f834d3486b63d94a1c3bfa31f366fbcad1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 10 Mar 2022 11:48:36 +0530 Subject: [PATCH] When using control masters also enable keep alives Prevents the master connection from becoming stale. Use ssh protocol keep alives rather than tcp ones as tcp ones are often blocked by firewalls and also spoofable. --- kittens/ssh/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kittens/ssh/main.py b/kittens/ssh/main.py index fe6de7189..cf14e56bf 100644 --- a/kittens/ssh/main.py +++ b/kittens/ssh/main.py @@ -447,6 +447,9 @@ def connection_sharing_args(opts: SSHOptions, kitty_pid: int) -> List[str]: '-o', 'ControlMaster=auto', '-o', f'ControlPath={cp}', '-o', 'ControlPersist=yes', + '-o', 'ServerAliveInterval=60', + '-o', 'ServerAliveCountMax=5', + '-o', 'TCPKeepAlive=no', ] return ans