Textualize / rich

Rich is a Python library for rich text and beautiful formatting in the terminal.
https://rich.readthedocs.io/en/latest/
MIT License
49.65k stars 1.73k forks source link

[REQUEST]Provide a way to change the choices separator when passing choices arg to Prompt.ask. #3552

Open vivekkeshore opened 2 weeks ago

vivekkeshore commented 2 weeks ago

The default choices separator is "/", and there is no way to customise it.

Example

from rich.prompt import Prompt

predicate = Prompt.ask(
    f"[green]Enter the animal name[/green]",
    choices=["Lion", "Tiger", "Bear", "Giraffe", "Elephant"],
    case_sensitive=False,
    show_choices=True
)

Otutput

Enter the animal name [Lion/Tiger/Bear/Giraffe/Elephant]:

I would like to customise the separator, for example.

Enter the animal name [Lion, Tiger, Bear, Giraffe, Elephant]:

Or

Enter the animal name [Lion | Tiger | Bear | Giraffe | Elephant]:

github-actions[bot] commented 2 weeks ago

Thank you for your issue. Give us a little time to review it.

PS. You might want to check the FAQ if you haven't done so already.

This is an automated reply, generated by FAQtory