Implement prefixCommand and chdir