Make using kitty askpass optional

This commit is contained in:
Kovid Goyal
2022-03-14 11:38:31 +05:30
parent 71027e74e0
commit 90561682cf
7 changed files with 71 additions and 32 deletions

View File

@@ -107,4 +107,11 @@ opt('login_shell', '', long_text='''
The login shell to execute on the remote host. By default, the remote user account's
login shell is used.''')
opt('askpass', 'unless-set', long_text='''
Control the program SSH uses to ask for passwords or confirmation of host keys etc.
The default is to use kitty's native askpass, unless the SSH_ASKPASS environment variable
is set. Set it to :code:`ssh` to not interfere with the normal ssh askpass mechanism at all,
which typically means that ssh will prompt at the terminal. Set it to :code:`native` to always use
kitty's native, built-in askpass implementation.
''')
egr() # }}}

View File

@@ -7,6 +7,9 @@ from kitty.conf.utils import merge_dicts, to_bool
class Parser:
def askpass(self, val: str, ans: typing.Dict[str, typing.Any]) -> None:
ans['askpass'] = str(val)
def copy(self, val: str, ans: typing.Dict[str, typing.Any]) -> None:
for k, v in copy(val, ans["copy"]):
ans["copy"][k] = v

View File

@@ -5,6 +5,7 @@ import kittens.ssh.copy
option_names = ( # {{{
'askpass',
'copy',
'cwd',
'env',
@@ -17,6 +18,7 @@ option_names = ( # {{{
class Options:
askpass: str = 'unless-set'
cwd: str = ''
hostname: str = '*'
interpreter: str = 'sh'