automatically set Dir.cwd after forking a new process