docs: def promptyn(msg, default=None):
      """ Display a blocking prompt until the user confirms """
      while True:
          yes = "Y" if default else "y"
          if default or default is None:
              no = "n"
          else:
              no = "N"
          confirm = prompt("%s [%s/%s]" % (msg, yes, no), "").lower()
          if confirm in ("y", "yes"):
              return True
          elif confirm in ("n", "no"):
              return False
          elif not confirm and default is not None:
              return default