'Executed before each command. Append the line to history and then log
the line to the output.'

def precmd(self, line):

    if len(line.strip()):
        self.cmdhistory.append(line)
    self.io.log((self.prompt + line))
    return line
