pub fn term_width_or_max() -> usize {
term_width().unwrap_or(400)
}
pub fn term_width() -> Option<usize> {
term_width_height().map(|x| x.0)
}
pub fn term_width_height() -> Option<(usize, usize)> {
if cfg!(feature = "__test") {
Some((60, 20))
} else {
use terminal_size::*;
terminal_size().map(|(Width(w), Height(h))| ((w as usize).min(400), (h as usize).min(400)))
}
}