make pty_job more resilient against prompt changes