From f9ac423fdd603df282ea11b960e2bd3de40f999a Mon Sep 17 00:00:00 2001 From: panki27 Date: Tue, 24 Apr 2018 19:42:36 +0200 Subject: [PATCH] CTRL-C now quits cleanly --- minebash | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/minebash b/minebash index c699430..838f464 100755 --- a/minebash +++ b/minebash @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -#TODO: highscore, monochrome, expect ctrl c, flags red if too many +#TODO: highscore, monochrome, flags red if too many import random, io, sys, time, os import curses @@ -398,4 +398,7 @@ def main(stdscr): print_footer(stdscr) stdscr.refresh() if __name__ == "__main__": - wrapper(main) \ No newline at end of file + try: + wrapper(main) + except KeyboardInterrupt: + sys.exit(0) \ No newline at end of file