fixed the update_terminal_cwd problem