Change terminal fallback width to 80

This commit is contained in:
Denis Isidoro 2020-05-12 10:13:21 -03:00 committed by GitHub
parent a754a6b041
commit 317cc34016
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,7 @@
use terminal_size::{terminal_size, terminal_size_using_fd, Height, Width}; use terminal_size::{terminal_size, terminal_size_using_fd, Height, Width};
const FALLBACK_WIDTH: u16 = 80;
fn width_with_shell_out() -> u16 { fn width_with_shell_out() -> u16 {
use std::process::Command; use std::process::Command;
use std::process::Stdio; use std::process::Stdio;
@ -30,7 +32,7 @@ fn width_with_shell_out() -> u16 {
u16::from_str_radix(data.next().expect("Not enough data"), 10) u16::from_str_radix(data.next().expect("Not enough data"), 10)
.expect("Invalid base-10 number") .expect("Invalid base-10 number")
} }
_ => 40, _ => FALLBACK_WIDTH,
} }
} }