[fix] Prefill input with long color question

This commit is contained in:
ljf 2021-09-14 21:14:32 +02:00 committed by ljf (zamentur)
parent f414a1656a
commit 08f7866f77

View file

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