diff --git a/scripts/tui.py b/scripts/tui.py index ac6cc0c..3ab2295 100644 --- a/scripts/tui.py +++ b/scripts/tui.py @@ -34,7 +34,11 @@ class HendrikTUI: self.h, self.w = 0, 0 def run(self): - curses.wrapper(self._main) + try: + curses.wrapper(self._main) + except KeyboardInterrupt: + pass + print("Exiting.") def _main(self, stdscr): curses.use_default_colors() @@ -56,7 +60,10 @@ class HendrikTUI: self._draw(stdscr) curses.curs_set(0 if self.processing else 2) - key = stdscr.getch() + try: + key = stdscr.getch() + except KeyboardInterrupt: + break if not self.processing: self._handle_key(stdscr, key)