diff --git a/src/main.rs b/src/main.rs index c0b13ae..9ba0a3d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,7 +12,12 @@ use std::io::stdout; fn main() -> Result<(), Box> { enable_raw_mode()?; - let (width, height) = crossterm::terminal::size()?; + let (mut width, mut height) = crossterm::terminal::size()?; + if width == 0 || height == 0 { + // Fallback for SSH or terminals that don't report size + width = 80; + height = 24; + } println!("Width: {}, Height: {}", width, height); // if width < 15 || height < 15 { // disable_raw_mode()?;