'changes dir'

def handle_cd(self, cmd):

    if (len(cmd) != 2):
        print(u'Invalid    syntax:    cd    path', file=self.output)
        return
    path = os.path.expandvars(os.path.expanduser(cmd[1]))
    try:
        os.chdir(path)
    except OSError as ex:
        print((u'cd:    %s\n' % ex), file=self.output)
