From ae1f7caf88f9e289e0ef414ab92227d8d5cc2cde Mon Sep 17 00:00:00 2001 From: Guillaume Chazarain Date: Sun, 26 May 2013 18:52:48 +0200 Subject: [PATCH] Cleanly exit on SIGINT otherwise python3 will leave the terminal in an unusable state. --- iotop/ui.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iotop/ui.py b/iotop/ui.py index 72ed7d7..a104114 100644 --- a/iotop/ui.py +++ b/iotop/ui.py @@ -483,6 +483,8 @@ class IOTopUI(object): def run_iotop_window(win, options): if options.batch: signal.signal(signal.SIGPIPE, signal.SIG_DFL) + else: + signal.signal(signal.SIGINT, lambda *args, **kwargs: sys.exit(0)) taskstats_connection = TaskStatsNetlink(options) process_list = ProcessList(taskstats_connection, options) ui = IOTopUI(win, process_list, options) -- 2.11.4.GIT