tui: switch to using tokio + EventStream for processing crossterm events (#2489)

bringing the tui more into tokio-land to make it easier to factorize.

fyi @bolinfest
This commit is contained in:
Jeremy Rose
2025-08-20 10:11:09 -07:00
committed by GitHub
parent 8481eb4c6e
commit 61bbabe7d9
13 changed files with 396 additions and 390 deletions

View File

@@ -247,10 +247,11 @@ pub async fn run_main(
}
run_ratatui_app(cli, config, should_show_trust_screen)
.await
.map_err(|err| std::io::Error::other(err.to_string()))
}
fn run_ratatui_app(
async fn run_ratatui_app(
cli: Cli,
config: Config,
should_show_trust_screen: bool,
@@ -275,7 +276,7 @@ fn run_ratatui_app(
let Cli { prompt, images, .. } = cli;
let mut app = App::new(config.clone(), prompt, images, should_show_trust_screen);
let app_result = app.run(&mut terminal);
let app_result = app.run(&mut terminal).await;
let usage = app.token_usage();
restore();