refactor: replace term_size with terminal_size (#3087)

This commit is contained in:
David Knaack
2021-09-23 17:52:51 +02:00
committed by GitHub
parent 888a653c32
commit b22c54fccc
4 changed files with 11 additions and 9 deletions
+3 -2
View File
@@ -15,6 +15,7 @@ use std::fs;
use std::path::{Path, PathBuf};
use std::string::String;
use std::time::{Duration, Instant};
use terminal_size::terminal_size;
/// Context contains data or common methods that may be used by multiple modules.
/// The data contained within Context will be relevant to this particular rendering
@@ -138,8 +139,8 @@ impl<'a> Context<'a> {
repo: OnceCell::new(),
shell,
right,
width: term_size::dimensions()
.map(|(width, _)| width)
width: terminal_size()
.map(|(w, _)| w.0 as usize)
.unwrap_or_default(),
#[cfg(test)]
env: HashMap::new(),