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
Live console widget #125
Comments
I am looking into this too. Could we emulate this with an autoscrolling ScrollView? |
Did you get any further in this topic? I have a pytorch-lightning script that prints to console and I would like to encapsulate that printing inside a Panel (or a live console widget) so that the prints of the module won't be in top of the interface when it starts |
When I try to using rich.console inside textual, BOOM! everything broken. |
@willmcgugan Please implement this feature. I have an application that is heavily dependant on Rich, Rich Handlers, Rich Logging, Rich Console and now Textual (can you tell I like your work lol), and the last piece of the puzzle is getting Rich Console to work as a widget in Textual. I've been driving myself mad for days thinking the bug was in my code until I stumbled upon this thread. |
@DanielATucker Can something like this work?
|
@yamatteo, That's not exactly what I'm looking for. I have an application that uses console.input() and Rich logging to simulate a bash screen. When I try to add an input to the code you wrote, my terminal just hangs indefinitely with no response. Maybe if we could integrate https://github.com/sirfuzzalot/textual-inputs then have it displayed using your console_outputs. If not, I understand, but could you look at my code and point me in the right direction of integration? https://github.com/DanielATucker/Brain. The main console logic is in Brain.py under def switchboard |
@DanielATucker is it a REPL you want?
|
@yamatteo yes, your fix is exactly what I needed. Thanks for your help! |
@yamatteo How would add to the console from outside of the OutConsole. For example in the on_mount I am trying to add console.print("Hello") after both the InConsole and Outconsole, but when I run the code it never shows up, anything else I try ends with a series or errors. I have been trying for days to figure out how to print to the console from other parts of my program, eg. error messages and status updates and such. |
@DanielATucker You can do as follow:
Maybe I should point out that this is not the clean way to do it in textual. I'm sure the developer is cooking some proper widget that will work in harmony with the rest of the framework. This is just a dirty hack. |
Did we solve your problem? Consider buying the Textualize developers a coffee to say thanks. |
Request to re-open this issue! |
It would be nice to have a widget that behaves like a console.
At first, just able to print and auto-scroll, and scroll bar, with auto-refresh.
console.print("another brick in the wall")
Maybe reuse Rich's Live View / Console?
The text was updated successfully, but these errors were encountered: