GNOME Bugzilla – Bug 670924
Ctrl-C does not terminate GTK3 Gtk.main() loop when program run from command line
Last modified: 2012-03-01 13:15:17 UTC
In a normal python program, Ctrl-C will set up a KeyboardInterrupt and terminate the program. This works with a normal python script, including GTK2 gtk.main(), but GTK3 Gtk.main() (even when used in a more robust GTK program than coded below) will not terminate with Ctrl-C requiring a Ctrl-Z and killing the job to terminate. See the commmand line output below: $ python -c "while True: > pass > " ^CTraceback (most recent call last):
+ Trace 229756
KeyboardInterrupt
$ python -c "from gi.repository import Gtk > Gtk.main() > " ^C ^C ^Z [1]+ Stopped python -c "from gi.repository import Gtk Gtk.main() " $ kill %1 [1]+ Stopped python -c "from gi.repository import Gtk Gtk.main() " The behaviour under Gtk.main() should be changed to respond to the KeyboardInterrupt.
I think this is a duplicate of Bug 622084 - Ctrl+C does not exit gtk app
indeed. *** This bug has been marked as a duplicate of bug 622084 ***