def tty_input(prompt: str, default):
    """ Prompts the user, using the default if the response is empty. """
    if isinstance(default, bool):
        return "y" in input(prompt + "? (y/n) ").strip().lower()

    suffix = f"Default {default}: " if default else ""
    ans = input(prompt + "? " + suffix).strip()
    return type(default)(ans) if len(ans) != 0 else default