We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug
When calling Prompt.ask it will give you also the text input you type before calling it. Example:
Prompt.ask
import time from rich.prompt import Prompt time.sleep(5) prompt = Prompt.ask("Write something") print(prompt)
For example if I type hello during the sleep and then world when asked the output is:
hello
world
helloWrite something: world helloworld
Sometimes it doesn't even wait for my actual input when asked (I can't reproduce it deterministically):
hello Write something: hello
Are these behaviours expected?
Platform
Diagnose:
╭───────────────────────── <class 'rich.console.Console'> ─────────────────────────╮ │ A high level console interface. │ │ │ │ ╭──────────────────────────────────────────────────────────────────────────────╮ │ │ │ <console width=176 ColorSystem.TRUECOLOR> │ │ │ ╰──────────────────────────────────────────────────────────────────────────────╯ │ │ │ │ color_system = 'truecolor' │ │ encoding = 'utf-8' │ │ file = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'> │ │ height = 15 │ │ is_alt_screen = False │ │ is_dumb_terminal = False │ │ is_interactive = True │ │ is_jupyter = False │ │ is_terminal = True │ │ legacy_windows = False │ │ no_color = False │ │ options = ConsoleOptions( │ │ size=ConsoleDimensions(width=176, height=15), │ │ legacy_windows=False, │ │ min_width=1, │ │ max_width=176, │ │ is_terminal=True, │ │ encoding='utf-8', │ │ max_height=15, │ │ justify=None, │ │ overflow=None, │ │ no_wrap=False, │ │ highlight=None, │ │ markup=None, │ │ height=None │ │ ) │ │ quiet = False │ │ record = False │ │ safe_box = True │ │ size = ConsoleDimensions(width=176, height=15) │ │ soft_wrap = False │ │ stderr = False │ │ style = None │ │ tab_size = 8 │ │ width = 176 │ ╰──────────────────────────────────────────────────────────────────────────────────╯ ╭─── <class 'rich._windows.WindowsConsoleFeatures'> ────╮ │ Windows features available. │ │ │ │ ╭───────────────────────────────────────────────────╮ │ │ │ WindowsConsoleFeatures(vt=False, truecolor=False) │ │ │ ╰───────────────────────────────────────────────────╯ │ │ │ │ truecolor = False │ │ vt = False │ ╰───────────────────────────────────────────────────────╯ ╭────── Environment Variables ───────╮ │ { │ │ 'TERM': 'xterm-256color', │ │ 'COLORTERM': 'truecolor', │ │ 'CLICOLOR': None, │ │ 'NO_COLOR': None, │ │ 'TERM_PROGRAM': 'vscode', │ │ 'COLUMNS': None, │ │ 'LINES': None, │ │ 'JUPYTER_COLUMNS': None, │ │ 'JUPYTER_LINES': None, │ │ 'JPY_PARENT_PID': None, │ │ 'VSCODE_VERBOSE_LOGGING': None │ │ } │ ╰────────────────────────────────────╯ platform="Linux"
Version: rich==13.4.2
rich==13.4.2
The text was updated successfully, but these errors were encountered:
We found the following entry in the FAQ which you may find helpful:
Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.
This is an automated reply, generated by FAQtory
Sorry, something went wrong.
This is an expected behavior of terminals. Any keys you press are buffered in standard input until something, like input(), reads from it.
I hope we solved your problem.
If you like using Rich, you might also enjoy Textual
No branches or pull requests
Describe the bug
When calling
Prompt.ask
it will give you also the text input you type before calling it.Example:
For example if I type
hello
during the sleep and thenworld
when asked the output is:Sometimes it doesn't even wait for my actual input when asked (I can't reproduce it deterministically):
Are these behaviours expected?
Platform
Click to expand
Diagnose:
Version:
rich==13.4.2
The text was updated successfully, but these errors were encountered: