From 49cba035eaffe5edd1bb4829b3625564920b178e Mon Sep 17 00:00:00 2001 From: Yoav Kleinberger Date: Sun, 3 Jul 2016 17:39:29 +0300 Subject: [PATCH] tools/scyllatop: leave terminal in a functioning state when user quits with CTRL-C closes issue #1417. Signed-off-by: Yoav Kleinberger Message-Id: <1467556769-11851-1-git-send-email-yoav@scylladb.com> --- tools/scyllatop/scyllatop.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tools/scyllatop/scyllatop.py b/tools/scyllatop/scyllatop.py index d3fc54b70c..092de5eab2 100755 --- a/tools/scyllatop/scyllatop.py +++ b/tools/scyllatop/scyllatop.py @@ -14,12 +14,6 @@ import signal import urwid -def halt(* args): - quit() - -signal.signal(signal.SIGINT, halt) - - def shell(): try: import IPython @@ -41,7 +35,10 @@ def main(metricPatterns, interval, collectd): liveDataThread = threading.Thread(target=lambda: liveData.go(loop)) liveDataThread.daemon = True liveDataThread.start() - loop.run() + try: + loop.run() + except KeyboardInterrupt: + pass if __name__ == '__main__': description = '\n'.join(['A top-like tool for scylladb collectd metrics.',