INNER CODE UNIT · Rust
run
kaplanelad/shellfirm · shellfirm/src/tui/mod.rs:120
pub fn run(config: &Config) -> Result<crate::CmdExit> {
let mut stdout = io::stdout();
enable_raw_mode().map_err(|e| Error::Other(e.to_string()))?;
execute!(stdout, EnterAlternateScreen).map_err(|e| Error::Other(e.to_string()))?;
let backend = CrosstermBackend::new(stdout);
let mut terminal = Terminal::new(backend).map_err(|e| Error::Other(e.to_string()))?;
let mut app = app::App::new(config)?;
let res = run_loop(&mut terminal, &mut app);
disable_raw_mode().ok();
execute!(terminal.backend_mut(), LeaveAlternateScreen).ok();
res?;
Ok(crate::CmdExit {
code: exitcode::OK,
message: None,
})
}