Debugging width height error
All checks were successful
Deploy to VPS / deploy (push) Successful in 1m12s
All checks were successful
Deploy to VPS / deploy (push) Successful in 1m12s
This commit is contained in:
11
src/main.rs
11
src/main.rs
@@ -13,11 +13,12 @@ use std::io::stdout;
|
|||||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
enable_raw_mode()?;
|
enable_raw_mode()?;
|
||||||
let (width, height) = crossterm::terminal::size()?;
|
let (width, height) = crossterm::terminal::size()?;
|
||||||
if width < 15 || height < 15 {
|
println!("Width: {}, Height: {}", width, height);
|
||||||
disable_raw_mode()?;
|
// if width < 15 || height < 15 {
|
||||||
println!("Your console is too small.");
|
// disable_raw_mode()?;
|
||||||
return Ok(());
|
// println!("Your console is too small.");
|
||||||
}
|
// return Ok(());
|
||||||
|
// }
|
||||||
let mut stdout = stdout();
|
let mut stdout = stdout();
|
||||||
execute!(stdout, EnterAlternateScreen)?;
|
execute!(stdout, EnterAlternateScreen)?;
|
||||||
let backend = CrosstermBackend::new(stdout);
|
let backend = CrosstermBackend::new(stdout);
|
||||||
|
|||||||
Reference in New Issue
Block a user