code: def patched_forkpty(self):
          
          pid, master_fd = self.original_os_forkpty()
          if not pid:
              _LOG('Fork detected. Reinstalling Manhole.')
              self.reinstall()
          return pid, master_fd
docs: Fork a new process with a new pseudo-terminal as controlling tty.