1. nakamura
  2. silk

Commits

nakamura  committed fc2c232

sync terminals only if child still alived

  • Participants
  • Parent commits 0856dff
  • Branches default

Comments (0)

Files changed (1)

File silk.py

View file
 
         self.set_size_request(self.width, self.height)
 
+    @property
+    def child_exited(self):
+        # if child exited, Terminal.get_pty_object() return None
+        # XXX: realy?
+        return self.get_pty_object() is None
+
     def run_command(self, command=None):
         if command is None:
             # TODO: use USER's login shell
         if text in ('\n', '\r', '\r\n'):
             self.terminal.disconnect_by_func(self.do_terminal_commit)
             self.terminal.feed('\r\n', 2)
-            self._sync_check.set_active(True)
 
             # to avoid this input being feeded to this command,
             # call run_command after this callback
         self._grid.set_size_request(w, h)
 
     def do_term_commit(self, term_frame, text, length):
-        if term_frame.terminal.is_focus() and term_frame.is_synced:
+        if not term_frame.terminal.child_exited and \
+           term_frame.terminal.is_focus() and term_frame.is_synced:
             for t in self.terminals:
-                if t is not term_frame and t.is_synced:
+                if t is not term_frame and \
+                   not t.terminal.child_exited and t.is_synced:
                     t.terminal.feed_child(text, length)