diff --git a/terminatorlib/terminator.py b/terminatorlib/terminator.py index 093d9b24..d16ab4b9 100755 --- a/terminatorlib/terminator.py +++ b/terminatorlib/terminator.py @@ -322,8 +322,13 @@ class Terminator(Borg): else: numstr = '%d' + terminals = [] + for window in self.windows: + containers, win_terminals = enumerate_descendants(window) + terminals.extend(win_terminals) + for term in self.get_target_terms(widget): - idx = self.terminals.index(term) + idx = terminals.index(term) term.feed(numstr % (idx + 1)) def get_target_terms(self, widget): diff --git a/terminatorlib/util.py b/terminatorlib/util.py index 872b76d0..57605cd6 100755 --- a/terminatorlib/util.py +++ b/terminatorlib/util.py @@ -268,7 +268,7 @@ def enumerate_descendants(parent): terminals.append(descendant) while len(containerstmp) > 0: - child = containerstmp.pop() + child = containerstmp.pop(0) for descendant in child.get_children(): if maker.isinstance(descendant, 'Container'): containerstmp.append(descendant)