diff --git a/docs/changelog.rst b/docs/changelog.rst index 6b7a4f67b..0c9c26b2d 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -87,6 +87,8 @@ Detailed list of changes - Allow showing the working directory of the active window in tab titles (:pull:`5314`) +- ssh kitten: Allow completion of ssh options between the destination and command (:iss:`5322`) + 0.25.2 [2022-06-07] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kittens/ssh/completion.py b/kittens/ssh/completion.py index 6fe21f773..8a2710451 100644 --- a/kittens/ssh/completion.py +++ b/kittens/ssh/completion.py @@ -291,6 +291,7 @@ def complete_option(ans: Completions, prefix: str = '-') -> None: def complete(ans: Completions, words: Sequence[str], new_word: bool) -> None: options = ssh_options() expecting_arg = False + seen_destination = False types = ['' for i in range(len(words))] for i, word in enumerate(words): if expecting_arg: @@ -302,8 +303,10 @@ def complete(ans: Completions, words: Sequence[str], new_word: bool) -> None: if len(word) == 2 and options.get(word[1]): expecting_arg = True continue + if seen_destination: + break types[i] = 'destination' - break + seen_destination = True if new_word: if words: if expecting_arg: