mirror of
https://gitlab.com/niansa/pilang.git
synced 2025-03-06 20:48:26 +01:00
Improved ctrl+c and ctrl+d handling in CLI
This commit is contained in:
parent
308d29247c
commit
6cf25da963
1 changed files with 8 additions and 1 deletions
9
cli.py
9
cli.py
|
@ -29,7 +29,14 @@ if len(sys.argv) == 1: # CLI loop
|
|||
main = main_class()
|
||||
while True:
|
||||
print(">>> ", end="", flush=True)
|
||||
commandstr = input()
|
||||
try:
|
||||
commandstr = input()
|
||||
except EOFError:
|
||||
print()
|
||||
sys.exit(0)
|
||||
except KeyboardInterrupt:
|
||||
print()
|
||||
continue
|
||||
res = main.get_rstring(main.run_command(commandstr), errorsonly=False)
|
||||
if res != None:
|
||||
print(res)
|
||||
|
|
Loading…
Add table
Reference in a new issue