This commit is contained in:
@@ -12,7 +12,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 (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);
|
println!("Width: {}, Height: {}", width, height);
|
||||||
// if width < 15 || height < 15 {
|
// if width < 15 || height < 15 {
|
||||||
// disable_raw_mode()?;
|
// disable_raw_mode()?;
|
||||||
|
|||||||
Reference in New Issue
Block a user