Open terminal in specified directory (and optionally run command)