Delete lots of stuff
This commit is contained in:
parent
742e7725ab
commit
00c905eff5
22 changed files with 46 additions and 2076 deletions
|
|
@ -1,46 +1,13 @@
|
|||
// TODO Make as few things async as necessary
|
||||
|
||||
#![warn(clippy::use_self)]
|
||||
|
||||
pub mod client;
|
||||
mod config;
|
||||
mod never;
|
||||
mod ui;
|
||||
|
||||
use std::io;
|
||||
|
||||
use config::Config;
|
||||
use crossterm::event::{DisableMouseCapture, EnableMouseCapture};
|
||||
use crossterm::execute;
|
||||
use crossterm::terminal::{EnterAlternateScreen, LeaveAlternateScreen};
|
||||
use tui::backend::CrosstermBackend;
|
||||
use tui::Terminal;
|
||||
use toss::terminal::Terminal;
|
||||
use ui::Ui;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
let config = Box::leak(Box::new(Config::load()));
|
||||
|
||||
let mut terminal = Terminal::new(CrosstermBackend::new(io::stdout()))?;
|
||||
|
||||
crossterm::terminal::enable_raw_mode()?;
|
||||
execute!(
|
||||
terminal.backend_mut(),
|
||||
EnterAlternateScreen,
|
||||
EnableMouseCapture
|
||||
)?;
|
||||
|
||||
// Defer error handling so the terminal always gets restored properly
|
||||
let result = Ui::run(config, &mut terminal).await;
|
||||
|
||||
execute!(
|
||||
terminal.backend_mut(),
|
||||
LeaveAlternateScreen,
|
||||
DisableMouseCapture
|
||||
)?;
|
||||
crossterm::terminal::disable_raw_mode()?;
|
||||
|
||||
result?;
|
||||
|
||||
let mut terminal = Terminal::new()?;
|
||||
Ui::run(&mut terminal).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue