mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-26 18:22:09 +02:00
ask kitten: Use the default value as input text
Prefill the current value when changing the tab title.
This commit is contained in:
@@ -298,7 +298,15 @@ def main(args: List[str]) -> Response:
|
||||
|
||||
prompt = '> '
|
||||
with suppress(KeyboardInterrupt, EOFError):
|
||||
response = input(prompt)
|
||||
if cli_opts.default:
|
||||
def prefill_text():
|
||||
readline.insert_text(cli_opts.default)
|
||||
readline.redisplay()
|
||||
readline.set_pre_input_hook(prefill_text)
|
||||
response = input(prompt)
|
||||
readline.set_pre_input_hook()
|
||||
else:
|
||||
response = input(prompt)
|
||||
return {'items': items, 'response': response}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user