(self, uuid=None, title=None, cmd=None, split_vert=False)
Split a terminal by UUID and immediately runs the specified command in the new terminal
Split a terminal by UUID and immediately runs the specified command in the new terminal
Split a terminal by UUID and immediately runs the specified command in the new terminal
def new_terminal_cmd(self, uuid=None, title=None, cmd=None, split_vert=False):
        """Split a terminal by UUID and immediately runs the specified command in the new terminal"""
        if not uuid:
            return "ERROR: No UUID specified"

        terminal = self.terminator.find_terminal_by_uuid(uuid)

        terminals_before = set(self.get_terminals())
        if not terminal:
            return "ERROR: Terminal with supplied UUID not found"

        # get current working dir out of target terminal
        cwd = terminal.get_cwd()

        # get current container
        container = self.get_terminal_container(terminal)
        maker = Factory()
        sibling = maker.make('Terminal')
        sibling.set_cwd(cwd)
        if title: sibling.titlebar.set_custom_string(title)
        sibling.spawn_child(init_command=cmd)

        # split and run command in new terminal
        container.split_axis(terminal, split_vert, cwd, sibling)

        terminals_after = set(self.get_terminals())
        # Detect the new terminal UUID
        new_terminal_set = list(terminals_after - terminals_before)
        if len(new_terminal_set) != 1:
            return "ERROR: Cannot determine the UUID of the added terminal"
        else:
            return new_terminal_set[0]
def new_terminal_cmd ( self , uuid = None , title = None , cmd = None , split_vert = False ) : if not uuid : return "ERROR: No UUID specified" terminal = self . terminator . find_terminal_by_uuid ( uuid ) terminals_before = set ( self . get_terminals ( ) ) if not terminal : return "ERROR: Terminal with supplied UUID not found" # get current working dir out of target terminal cwd = terminal . get_cwd ( ) # get current container container = self . get_terminal_container ( terminal ) maker = Factory ( ) sibling = maker . make ( 'Terminal' ) sibling . set_cwd ( cwd ) if title : sibling . titlebar . set_custom_string ( title ) sibling . spawn_child ( init_command = cmd ) # split and run command in new terminal container . split_axis ( terminal , split_vert , cwd , sibling ) terminals_after = set ( self . get_terminals ( ) ) # Detect the new terminal UUID new_terminal_set = list ( terminals_after - terminals_before ) if len ( new_terminal_set ) != 1 : return "ERROR: Cannot determine the UUID of the added terminal" else : return new_terminal_set [ 0 ]