From 7a74ca52e8790b5aa387582c4d5a4977d02daec0 Mon Sep 17 00:00:00 2001 From: Bridget Date: Sun, 12 Apr 2020 22:13:48 +0200 Subject: [PATCH] Handle KeyboardInterrupt --- lslsh.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lslsh.py b/lslsh.py index 5b450f9..a01bae1 100644 --- a/lslsh.py +++ b/lslsh.py @@ -84,6 +84,9 @@ class Shell(cmd.Cmd): def run(): shell = Shell() - shell.cmdloop() + try: + shell.cmdloop() + except KeyboardInterrupt: + shell.do_exit(None) run()