From 5efcb35cfbc448da030024f1dc28267527282b6e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 14 May 2022 10:37:05 +0530 Subject: [PATCH] Only integrate with ssh kitten if shared connections are enabled for that host --- kitty/window.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kitty/window.py b/kitty/window.py index c5e43b75e..415f97a42 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -836,9 +836,10 @@ class Window: conn_data: Union[None, List[str], SSHConnectionData] = None if args: ssh_cmdline = sorted(self.child.foreground_processes, key=lambda p: p['pid'])[-1]['cmdline'] or [''] - idx = ssh_cmdline.index('--') - conn_data = [is_ssh_kitten_sentinel] + list(ssh_cmdline[:idx + 2]) - else: + if 'ControlPath=' in ' '.join(ssh_cmdline): + idx = ssh_cmdline.index('--') + conn_data = [is_ssh_kitten_sentinel] + list(ssh_cmdline[:idx + 2]) + if conn_data is None: args = self.child.foreground_cmdline conn_data = get_connection_data(args, self.child.foreground_cwd or self.child.current_cwd or '') if conn_data is None: