from __future__ import annotations import sys def prompt_input(prompt: str) -> str: try: return input(prompt) except EOFError as exc: raise RuntimeError("Interactive input ended before choices were complete.") from exc def pause_if_interactive() -> None: if sys.stdin.isatty(): try: input("\nPress Enter to close...") except EOFError: pass