-
Notifications
You must be signed in to change notification settings - Fork 7
Use ratatui::run()
for managing terminal lifecycle
#142
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
Conversation
It seems the formatting defaults for edition 2024 are slightly different than 2021, which is why all those extraneous changes are in there; they were done automatically. |
Perhaps would you mind doing a quick PR for flipping to 2024 edition and then rebasing this change on that. I'll have to take a deeper look at this to understand the impact on the async changes. |
Done! See #143 . |
mut events: Events, | ||
query: Option<String>, | ||
) -> Result<()> { | ||
#[tokio::main] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, nice!
Added a few small tweaks to the approach:
Does this look good to you? |
I love it! |
This removes the custom
tui
module for setting up the terminal and panic handlers, and instead uses the newrun()
function from Ratatui 0.30. Something to note is that I had to change themain
func to be non-async, since therun
function takes a sync closure, so I used the Tokio runtime'sblock_on()
method inside it; I'd love to see a better way to do that.