clide/src/tui.rs

14 lines
366 B
Rust
Raw Normal View History

2026-01-17 14:04:02 -05:00
pub mod app;
2026-01-17 11:40:40 -05:00
use anyhow::{Context, Result};
2025-04-13 12:17:11 -04:00
2026-01-17 11:40:40 -05:00
pub fn start(root_path: std::path::PathBuf) -> Result<()> {
2025-04-13 12:17:11 -04:00
println!("Starting the TUI editor at {:?}", root_path);
2026-01-17 11:40:40 -05:00
let terminal = ratatui::init();
2026-01-17 14:04:02 -05:00
let app_result = app::App::new(&root_path)
.run(terminal)
.context("Failed to start the TUI editor.");
2026-01-17 11:40:40 -05:00
ratatui::restore();
app_result
}