diff --git a/docs/pages/changelog.rst b/docs/pages/changelog.rst index 3296309..814b410 100644 --- a/docs/pages/changelog.rst +++ b/docs/pages/changelog.rst @@ -4,6 +4,12 @@ Changelog ********* +2.1.1 (2025-08-28) +################### + +* Fixed compatibility with ``prompt_toolkit`` 3.0.52. Previously that version raised ability + ``AttributeError: 'VSplit' object has no attribute 'content'`` error. + 2.1.0 (2024-12-29) ################### diff --git a/pyproject.toml b/pyproject.toml index 91fe6b3..948d1ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ warn_unused_ignores = true [tool.poetry] name = "questionary" -version = "2.1.0" +version = "2.1.1" description = "Python library to build pretty command line user prompts ⭐️" authors = [ "Tom Bocklisch ",] maintainers = [ "Tom Bocklisch ", "Kian Cross "] diff --git a/questionary/prompts/select.py b/questionary/prompts/select.py index e41dbe5..b22f768 100644 --- a/questionary/prompts/select.py +++ b/questionary/prompts/select.py @@ -39,6 +39,7 @@ def select( show_selected: bool = False, show_description: bool = True, instruction: Optional[str] = None, + initial_choice: Optional[str] = None, **kwargs: Any, ) -> Question: """A list of items to select **one** option from. @@ -162,6 +163,11 @@ def select( merged_style = merge_styles_default([style]) + if initial_choice is not None: + ic_initial_choice = initial_choice + else: + ic_initial_choice = default + ic = InquirerControl( choices, default, @@ -171,7 +177,7 @@ def select( show_selected=show_selected, show_description=show_description, use_arrow_keys=use_arrow_keys, - initial_choice=default, + initial_choice=ic_initial_choice, ) def get_prompt_tokens(): diff --git a/questionary/version.py b/questionary/version.py index 9aa3f90..58039f5 100644 --- a/questionary/version.py +++ b/questionary/version.py @@ -1 +1 @@ -__version__ = "2.1.0" +__version__ = "2.1.1"