-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Labels
Description
- I've checked docs and closed issues for possible solutions.
- I can't find my issue in the FAQ.
Describe the bug
As stated in the title.
The "input" method of the Console class in rich.console.py fails to propagate the "end" attribute of the prompt variable passed in as one of the methods inputs when calling self.print()
It instead ignores the value of prompt.end and instead passes end="" to self.print()
def input(
self,
prompt: TextType = "",
*,
markup: bool = True,
emoji: bool = True,
password: bool = False,
stream: Optional[TextIO] = None,
) -> str:
"""Displays a prompt and waits for input from the user. The prompt may contain color / style.
It works in the same way as Python's builtin :func:`input` function and provides elaborate line editing and history features if Python's builtin :mod:`readline` module is previously loaded.
Args:
prompt (Union[str, Text]): Text to render in the prompt.
markup (bool, optional): Enable console markup (requires a str prompt). Defaults to True.
emoji (bool, optional): Enable emoji (requires a str prompt). Defaults to True.
password: (bool, optional): Hide typed text. Defaults to False.
stream: (TextIO, optional): Optional file to read input from (rather than stdin). Defaults to None.
Returns:
str: Text read from stdin.
"""
if prompt:
self.print(prompt, markup=markup, emoji=emoji, end="")Reactions are currently unavailable