Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/prompt_toolkit/shortcuts/choice_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class ChoiceInput(Generic[_T]):
:param show_frame: `bool` or
:class:`~prompt_toolkit.filters.Filter`. When True, surround the input
with a frame.
:param show_numbers: Whether to show the option numbers in front of each choice.
:param enable_interrupt: `bool` or
:class:`~prompt_toolkit.filters.Filter`. When True, raise
the ``interrupt_exception`` (``KeyboardInterrupt`` by default) when
Expand All @@ -99,6 +100,7 @@ def __init__(
symbol: str = ">",
bottom_toolbar: AnyFormattedText = None,
show_frame: FilterOrBool = False,
show_numbers: bool = True,
enable_suspend: FilterOrBool = False,
enable_interrupt: FilterOrBool = True,
interrupt_exception: type[BaseException] = KeyboardInterrupt,
Expand All @@ -114,6 +116,7 @@ def __init__(
self.style = style
self.symbol = symbol
self.show_frame = show_frame
self.show_numbers = show_numbers
self.enable_suspend = enable_suspend
self.interrupt_exception = interrupt_exception
self.enable_interrupt = enable_interrupt
Expand All @@ -129,7 +132,7 @@ def _create_application(self) -> Application[_T]:
select_character=self.symbol,
close_character="",
show_cursor=False,
show_numbers=True,
show_numbers=self.show_numbers,
container_style="class:input-selection",
default_style="class:option",
selected_style="",
Expand Down