From 8c8b6763b2c05e7e6132338b0058705e4c15e27b Mon Sep 17 00:00:00 2001 From: Lionel Dricot Date: Wed, 23 Feb 2022 10:43:46 +0100 Subject: [PATCH] quit on ctrl+c --- offpunk.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/offpunk.py b/offpunk.py index b3b9a4c..df40fa7 100755 --- a/offpunk.py +++ b/offpunk.py @@ -3562,7 +3562,13 @@ def main(): print("Type `help` to get the list of available command.") for line in torun_queue: gc.onecmd(line) - gc.cmdloop() + + while True: + try: + gc.cmdloop() + except KeyboardInterrupt: + print("\n") + gc.do_quit(line) if __name__ == '__main__': main()