Only integrate with ssh kitten if shared connections are enabled for that host

This commit is contained in:
Kovid Goyal 2022-05-14 10:37:05 +05:30
parent 1b4cf1fea7
commit 5efcb35cfb
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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 ['']
if 'ControlPath=' in ' '.join(ssh_cmdline):
idx = ssh_cmdline.index('--')
conn_data = [is_ssh_kitten_sentinel] + list(ssh_cmdline[:idx + 2])
else:
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: