mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 22:28:24 +02:00
ssh kitten: Allow completion of ssh options between the destination and command
This contravenes the documented command line parsing behavior of ssh but matches its actual implementation. Sigh. Fixes #5322
This commit is contained in:
@@ -87,6 +87,8 @@ Detailed list of changes
|
|||||||
- Allow showing the working directory of the active window in tab titles
|
- Allow showing the working directory of the active window in tab titles
|
||||||
(:pull:`5314`)
|
(:pull:`5314`)
|
||||||
|
|
||||||
|
- ssh kitten: Allow completion of ssh options between the destination and command (:iss:`5322`)
|
||||||
|
|
||||||
|
|
||||||
0.25.2 [2022-06-07]
|
0.25.2 [2022-06-07]
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|||||||
@@ -291,6 +291,7 @@ def complete_option(ans: Completions, prefix: str = '-') -> None:
|
|||||||
def complete(ans: Completions, words: Sequence[str], new_word: bool) -> None:
|
def complete(ans: Completions, words: Sequence[str], new_word: bool) -> None:
|
||||||
options = ssh_options()
|
options = ssh_options()
|
||||||
expecting_arg = False
|
expecting_arg = False
|
||||||
|
seen_destination = False
|
||||||
types = ['' for i in range(len(words))]
|
types = ['' for i in range(len(words))]
|
||||||
for i, word in enumerate(words):
|
for i, word in enumerate(words):
|
||||||
if expecting_arg:
|
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]):
|
if len(word) == 2 and options.get(word[1]):
|
||||||
expecting_arg = True
|
expecting_arg = True
|
||||||
continue
|
continue
|
||||||
|
if seen_destination:
|
||||||
|
break
|
||||||
types[i] = 'destination'
|
types[i] = 'destination'
|
||||||
break
|
seen_destination = True
|
||||||
if new_word:
|
if new_word:
|
||||||
if words:
|
if words:
|
||||||
if expecting_arg:
|
if expecting_arg:
|
||||||
|
|||||||
Reference in New Issue
Block a user