diff --git a/sublimeibus/sublime-ibus-agent.py b/sublimeibus/sublime-ibus-agent.py index 9b7a49f..2e1e1e2 100644 --- a/sublimeibus/sublime-ibus-agent.py +++ b/sublimeibus/sublime-ibus-agent.py @@ -553,9 +553,13 @@ def __stdin_cb(self, fd, condition): print_command('setq', 'error', traceback.format_exc()) return True + def __io_error_cb(self, fd, condition): + exit() + def run(self): glib.idle_add(self.__start_cb) glib.io_add_watch(0, glib.IO_IN, self.__stdin_cb) + glib.io_add_watch(0, glib.IO_ERR | glib.IO_HUP, self.__io_error_cb) while True: try: super(IBusModeMainLoop, self).run() @@ -568,7 +572,6 @@ def run(self): if ic: ic.destroy() - if __name__ == "__main__": mainloop = IBusModeMainLoop(bus)