code: def _close_stdio():
      
      for fd in (sys.stdin, sys.stdout, sys.stderr):
        file_no = fd.fileno()
        fd.flush()
        fd.close()
        os.close(file_no)
docs: Close stdio streams to avoid output in the tty that launched pantsd.