Problem: Unexpected behavior after PTY child process fails to chdir(), as it then thinks it's the parent process. Solution: Exit the child process instead of returning.