'Handle a carriage return.'

def handleReturn(self, event):

    cmd = self.text.get('insert    linestart', 'insert    lineend')
    if self.node.waiting:
        self.node.write(event.char)
        return
    pos = cmd.find(self.prompt)
    if (pos >= 0):
        cmd = cmd[(pos + len(self.prompt)):]
    self.sendCmd(cmd)
