aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2023-03-26 00:33:26 -0400
committerJesse Luehrs <doy@tozt.net>2023-03-26 00:33:26 -0400
commit222bc5c66f7a4b80c04e805b72c70d0385784b25 (patch)
tree5e47e1bdbf690b6aa6c26789f2a925c9950d0702
parent266ad01efeca37461786b440f4e00cb35634c0ef (diff)
downloadfancy-prompt-222bc5c66f7a4b80c04e805b72c70d0385784b25.tar.gz
fancy-prompt-222bc5c66f7a4b80c04e805b72c70d0385784b25.zip
switch from term_size to terminal_size
-rw-r--r--Cargo.lock12
-rw-r--r--Cargo.toml2
-rw-r--r--src/data.rs4
3 files changed, 4 insertions, 14 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 7d1ab0c..e238608 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -204,7 +204,7 @@ dependencies = [
"hostname",
"regex",
"term",
- "term_size",
+ "terminal_size",
"users",
"walkdir",
]
@@ -610,16 +610,6 @@ dependencies = [
]
[[package]]
-name = "term_size"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e4129646ca0ed8f45d09b929036bafad5377103edd06e50bf574b353d2b08d9"
-dependencies = [
- "libc",
- "winapi",
-]
-
-[[package]]
name = "termcolor"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/Cargo.toml b/Cargo.toml
index bc0ab09..c258ed3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -21,7 +21,7 @@ git2 = "0.16"
hostname = "0.3"
regex = "1.7"
term = "0.7"
-term_size = "0.3"
+terminal_size = "0.2.5"
users = "0.11"
walkdir = "2.3"
diff --git a/src/data.rs b/src/data.rs
index ae89c9d..d30068e 100644
--- a/src/data.rs
+++ b/src/data.rs
@@ -69,8 +69,8 @@ fn hostname() -> Option<String> {
}
fn terminal_cols() -> Option<usize> {
- if let Some((w, _h)) = term_size::dimensions() {
- Some(w)
+ if let Some((w, _h)) = terminal_size::terminal_size() {
+ Some(usize::from(w.0))
} else {
None
}