docs: def terminate(self, wait=False):
          """Terminate the process."""
          if self.proc is not None:
              self.proc.stdout.close()
              try:
                  self.proc.terminate()
              except ProcessLookupError:
                  pass
              if wait:
                  self.proc.wait()