From 1bb3a0f7cc86a6ee693486dcf566f146ffb307f0 Mon Sep 17 00:00:00 2001 From: Chris Ball Date: Mon, 20 Aug 2007 22:58:52 +0000 Subject: Focus the output area by default, workaround a VTE problem In particular, VTE seems to be freezing the terminal when Python processes exit *before* flushing their output buffers to the terminal. Adding a sleep ameliorates it, but we need a real fix. --- (limited to 'activity.py') diff --git a/activity.py b/activity.py index 54a4544..914dc4b 100644 --- a/activity.py +++ b/activity.py @@ -199,7 +199,7 @@ class PippyActivity(Activity): self.text_buffer.set_text("".join(lines)) def gobutton_cb(self, button): - #self._vte.reset(True, True) + self._vte.grab_focus() self._vte.feed("\x1B[H\x1B[J") # FIXME: We're losing an odd race here @@ -213,7 +213,7 @@ class PippyActivity(Activity): file.write(line) file.close() - pid = self._vte.fork_command(sys.executable, ["python", "/tmp/pippy.py"]) + pid = self._vte.fork_command("/bin/sh", ["/bin/sh", "-c", "python /tmp/pippy.py; sleep 1"]) def _shared_cb(self, activity): self._logger.debug('My activity was shared') -- cgit v0.9.1