mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-09-22 12:07:15 +03:00
Fix getting connection data from ssh command line when -- is used in the command line
This broke the remote file kitten when using the ssh kitten as the later was changed to use -- recently. Fixes #3929
This commit is contained in:
parent
97a9261096
commit
f3333ce941
@ -38,6 +38,9 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
- Add :opt:`clear_all_mouse_actions` to clear all mouse actions defined to
|
||||
that point (:iss:`3907`)
|
||||
|
||||
- Fix the remote file kitten not working when using -- with ssh. The ssh kitten
|
||||
was recently changed to do this (:iss:`3929`)
|
||||
|
||||
|
||||
0.22.2 [2021-08-02]
|
||||
----------------------
|
||||
|
@ -146,15 +146,20 @@ def get_connection_data(args: List[str]) -> Optional[SSHConnectionData]:
|
||||
port: Optional[int] = None
|
||||
expecting_port = False
|
||||
expecting_option_val = False
|
||||
expecting_hostname = False
|
||||
|
||||
for i, arg in enumerate(args):
|
||||
if not found_ssh:
|
||||
if os.path.basename(arg).lower() in ('ssh', 'ssh.exe'):
|
||||
found_ssh = arg
|
||||
continue
|
||||
if expecting_hostname:
|
||||
return SSHConnectionData(found_ssh, arg, port)
|
||||
if arg.startswith('-') and not expecting_option_val:
|
||||
if arg in boolean_ssh_args:
|
||||
continue
|
||||
if arg == '--':
|
||||
expecting_hostname = True
|
||||
if arg.startswith('-p'):
|
||||
if arg[2:].isdigit():
|
||||
with suppress(Exception):
|
||||
|
Loading…
Reference in New Issue
Block a user