mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-28 11:11:47 +02:00
Get askpass basically working
This commit is contained in:
@@ -74,7 +74,7 @@ class HistoryCompleter:
|
||||
def option_text() -> str:
|
||||
return '''\
|
||||
--type -t
|
||||
choices=line,yesno,choices
|
||||
choices=line,yesno,choices,password
|
||||
default=line
|
||||
Type of input. Defaults to asking for a line of text.
|
||||
|
||||
@@ -361,6 +361,13 @@ def main(args: List[str]) -> Response:
|
||||
loop.loop(handler)
|
||||
return {'items': items, 'response': handler.response}
|
||||
|
||||
if cli_opts.type == 'password':
|
||||
import getpass
|
||||
if cli_opts.message:
|
||||
print(styled(cli_opts.message, bold=True))
|
||||
q = getpass.getpass()
|
||||
return {'items': items, 'response': q or ''}
|
||||
|
||||
import readline as rl
|
||||
readline = rl
|
||||
from kitty.shell import init_readline
|
||||
|
||||
Reference in New Issue
Block a user