def set_terminal(self, terminal):
        """Packs the terminal widget.
        """
        if self.terminal is not None:
            raise RuntimeError("TerminalBox: terminal already set")
        self.terminal = terminal
        self.terminal.connect("grab-focus", self.on_terminal_focus)
        self.terminal.connect("button-press-event", self.on_button_press, None)
        self.terminal.connect('child-exited', self.on_terminal_exited)

        self.pack_start(self.terminal, True, True, 0)
        self.terminal.show()
        self.add_scroll_bar()
Packs the terminal widget.