def prompt(
    text: str, 
    choices: List[T] | Generator[T, Any, None], 
    display: Callable[[T], str], 
    fzf_enabled: bool, 
    before_display: Optional[Callable[[T], T]] = None, 
    preview: Optional[str] = None
) -> T | None:
    """Prompt the user to pick from a list choices."""
    choice_picked = None
    before_display = before_display or (lambda x: x)

    is_just_one, choices = is_it_just_one_choice(choices)

    if is_just_one is True:
        logger.debug("Skipping prompt as there is only a single choice to choose from...")
        return next(choices) if isinstance(choices, itertools._tee) else choices[0]

    # silence the global logger so it doesn't mess with fzf or inquirer's output.
    previous_logger_level = mov_cli_logger.level
    mov_cli_logger.setLevel(logging.CRITICAL)

    choices, unwounded_choices = itertools.tee(choices)

    if fzf_enabled:
        logger.debug("Launching fzf...")
        # We pass this in as a generator to take advantage of iterfzf's streaming capabilities.
        # You can find that explained as the second bullet point here: https://github.com/dahlia/iterfzf#key-features
        choice_picked = iterfzf(
            iterable = ((display(before_display(choice)), choice) for choice in choices), 
            prompt = text + ": ", 
            ansi = True, 
            preview = preview
        )

    else:
        logger.debug("Launching inquirer (fallback ui)...")
        inquirer_result = inquirer.prompt(
            questions = [
                inquirer.List("choices", message = text, choices = [display(before_display(x)) for x in choices])
            ], 
            theme = MovCliTheme()
        )

        if inquirer_result is not None:
            choice_picked = inquirer_result["choices"]

    # restore the logger
    mov_cli_logger.setLevel(previous_logger_level)

    # Using this to remove ansi colours returned in the picked choice.
    ansi_remover = re.compile(r'\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])')

    if choice_picked is None:
        return None

    for choice in unwounded_choices:

        if ansi_remover.sub('', choice_picked) == ansi_remover.sub('', display(choice)):
            return choice

    return None
Prompt the user to pick from a list choices.
mov_cli/cli/ui.py