Skip to content
New issue

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

How to prompt for user input at the bottom of the terminal screen while printing text from the top down? #1911

Open
not-sekiun opened this issue Sep 4, 2024 · 2 comments

Comments

@not-sekiun
Copy link

I need to prompt for user input at the bottom of the terminal screen while still having any text being printed to be outputted at the top of the terminal screen to the bottom. This prompting needs to behave similarly to session.prompt_async and place nicely with an existing asyncio event loop handler while still supporting all the usual syntax highlighting and tab completion features. Is there some way I can do this or perhaps take in a prompt input within a bottom toolbar object?

@github-staff github-staff deleted a comment from not-sekiun Sep 4, 2024
@not-sekiun
Copy link
Author

not-sekiun commented Sep 5, 2024

check this out: Calculator https://github.com/prompt-toolkit/python-prompt-toolkit/blob/master/examples/full-screen/calculator.py

Thanks this is a good start, but I need it to be sort of compatible "out of the box" without any special modifications to how standard output is printed. This is because all the output is coming from loguru loggers within a FastAPI application and I want to make no changes to the loggers if possible. A full screen application might force me to have to modify my loggers to "play nice" with the application not to mention if it would even work with the asyncio event loop because it has to run in an existing event loop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@not-sekiun @kumara19bara and others