Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/menu/text_input.py
diff options
context:
space:
mode:
Diffstat (limited to 'archinstall/lib/menu/text_input.py')
-rw-r--r--archinstall/lib/menu/text_input.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/archinstall/lib/menu/text_input.py b/archinstall/lib/menu/text_input.py
index 05ca0f22..971df5fd 100644
--- a/archinstall/lib/menu/text_input.py
+++ b/archinstall/lib/menu/text_input.py
@@ -1,4 +1,5 @@
import readline
+import sys
class TextInput:
@@ -12,6 +13,14 @@ class TextInput:
def run(self) -> str:
readline.set_pre_input_hook(self._hook)
- result = input(self._prompt)
+ try:
+ result = input(self._prompt)
+ except (KeyboardInterrupt, EOFError):
+ # To make sure any output that may follow
+ # will be on the line after the prompt
+ sys.stdout.write('\n')
+ sys.stdout.flush()
+
+ result = ''
readline.set_pre_input_hook()
return result