Browse code

Restore default SIGINT handler so that xdot terminates on Ctrl-C.

Mike Kazantsev authored on 18/11/2016 10:37:06 • Jose Fonseca committed on 21/11/2016 10:59:43
Showing 1 changed files

... ...
@@ -74,6 +74,12 @@ Shortcuts:
74 74
             win.set_dotcode(sys.stdin.read())
75 75
         else:
76 76
             win.open_file(inputfile)
77
+
78
+    if sys.platform != 'win32':
79
+        # Reset KeyboardInterrupt SIGINT handler, so that glib loop can be stopped by it
80
+        import signal
81
+        signal.signal(signal.SIGINT, signal.SIG_DFL)
82
+
77 83
     Gtk.main()
78 84
 
79 85
 if __name__ == '__main__':