pub mod app;
pub mod components;
pub mod events;
pub mod keybindings;
pub mod repl_command;
pub mod state;
pub mod theme;
pub mod ui;
use std::io;
use anyhow::Result;
pub use app::TuiApp;
use crossterm::{
execute,
terminal::{
disable_raw_mode,
enable_raw_mode,
EnterAlternateScreen,
LeaveAlternateScreen,
},
};
use ratatui::{
backend::CrosstermBackend,
Terminal,
};
pub fn run() -> Result<()> {
enable_raw_mode()?;
let mut stdout = io::stdout();
execute!(stdout, EnterAlternateScreen)?;
let backend = CrosstermBackend::new(stdout);
let mut terminal = Terminal::new(backend)?;
let mut app = TuiApp::new();
let res = app.run(&mut terminal);
disable_raw_mode()?;
execute!(terminal.backend_mut(), LeaveAlternateScreen)?;
terminal.show_cursor()?;
res
}