[fix] Prefill input with long color question

This commit is contained in:
ljf 2021-09-14 21:14:32 +02:00
parent 6e714314f0
commit 3795f04f64

View file

@ -550,9 +550,10 @@ class Interface:
if is_password:
return getpass.getpass(colorize(m18n.g("colon", message), color))
elif not is_multiline:
print(colorize(m18n.g("colon", message), color), end="")
set_startup_hook(lambda: insert_text(prefill))
try:
value = input(colorize(m18n.g("colon", message), color))
value = input()
finally:
set_startup_hook()
return value