deps: use terminal_size instead of termsize

This commit is contained in:
Niyaz Nigmatullin 2022-08-21 10:43:10 +03:00
parent 212953e06a
commit c9a81f5a17
3 changed files with 34 additions and 96 deletions

124
Cargo.lock generated
View file

@ -55,7 +55,7 @@ version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"
dependencies = [
"winapi 0.3.9",
"winapi",
]
[[package]]
@ -78,7 +78,7 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
dependencies = [
"hermit-abi",
"libc",
"winapi 0.3.9",
"winapi",
]
[[package]]
@ -238,7 +238,7 @@ dependencies = [
"iana-time-zone",
"num-integer",
"num-traits",
"winapi 0.3.9",
"winapi",
]
[[package]]
@ -601,7 +601,7 @@ dependencies = [
"parking_lot",
"signal-hook",
"signal-hook-mio",
"winapi 0.3.9",
"winapi",
]
[[package]]
@ -610,7 +610,7 @@ version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2ae1b35a484aa10e07fe0638d02301c5ad24de82d310ccbd2f3693da5f09bf1c"
dependencies = [
"winapi 0.3.9",
"winapi",
]
[[package]]
@ -640,7 +640,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d91974fbbe88ec1df0c24a4f00f99583667a7e2e6272b2b92d294d81e462173"
dependencies = [
"nix",
"winapi 0.3.9",
"winapi",
]
[[package]]
@ -707,7 +707,7 @@ dependencies = [
"cfg-if",
"libc",
"socket2",
"winapi 0.3.9",
"winapi",
]
[[package]]
@ -911,7 +911,7 @@ checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867"
dependencies = [
"libc",
"match_cfg",
"winapi 0.3.9",
"winapi",
]
[[package]]
@ -930,7 +930,7 @@ dependencies = [
"core-foundation-sys",
"js-sys",
"wasm-bindgen",
"winapi 0.3.9",
"winapi",
]
[[package]]
@ -1002,16 +1002,6 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838"
[[package]]
name = "kernel32-sys"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
dependencies = [
"winapi 0.2.8",
"winapi-build",
]
[[package]]
name = "kqueue"
version = "1.0.6"
@ -1057,7 +1047,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd"
dependencies = [
"cfg-if",
"winapi 0.3.9",
"winapi",
]
[[package]]
@ -1193,7 +1183,7 @@ dependencies = [
"libc",
"mio",
"walkdir",
"winapi 0.3.9",
"winapi",
]
[[package]]
@ -1251,12 +1241,6 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3"
[[package]]
name = "numtoa"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef"
[[package]]
name = "once_cell"
version = "1.13.1"
@ -1339,7 +1323,7 @@ version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "628223faebab4e3e40667ee0b2336d34a5b960ff60ea743ddfdbcf7770bcfb66"
dependencies = [
"winapi 0.3.9",
"winapi",
]
[[package]]
@ -1434,7 +1418,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95f26dfd50c79dacf549a8a784734fff83a5e42736487464d782fc8a3a2f5563"
dependencies = [
"libc",
"winapi 0.3.9",
"winapi",
]
[[package]]
@ -1577,15 +1561,6 @@ dependencies = [
"bitflags",
]
[[package]]
name = "redox_termios"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8440d8acb4fd3d277125b4bd01a6f38aee8d814b3b5fc09b3f2b825d37d3fe8f"
dependencies = [
"redox_syscall",
]
[[package]]
name = "reference-counted-singleton"
version = "0.1.1"
@ -1621,7 +1596,7 @@ version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
dependencies = [
"winapi 0.3.9",
"winapi",
]
[[package]]
@ -1634,7 +1609,7 @@ dependencies = [
"log",
"num_cpus",
"rayon",
"winapi 0.3.9",
"winapi",
]
[[package]]
@ -1808,7 +1783,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0"
dependencies = [
"libc",
"winapi 0.3.9",
"winapi",
]
[[package]]
@ -1870,7 +1845,7 @@ dependencies = [
"libc",
"redox_syscall",
"remove_dir_all 0.5.3",
"winapi 0.3.9",
"winapi",
]
[[package]]
@ -1898,32 +1873,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df"
dependencies = [
"libc",
"winapi 0.3.9",
]
[[package]]
name = "termion"
version = "1.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "077185e2eac69c3f8379a4298e1e07cd36beb962290d4a51199acf0fdc10607e"
dependencies = [
"libc",
"numtoa",
"redox_syscall",
"redox_termios",
]
[[package]]
name = "termsize"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e86d824a8e90f342ad3ef4bd51ef7119a9b681b0cc9f8ee7b2852f02ccd2517"
dependencies = [
"atty",
"kernel32-sys",
"libc",
"termion",
"winapi 0.2.8",
"winapi",
]
[[package]]
@ -2178,7 +2128,7 @@ dependencies = [
"selinux",
"uucore",
"walkdir",
"winapi 0.3.9",
"winapi",
"xattr",
]
@ -2211,7 +2161,7 @@ dependencies = [
"clap 3.2.17",
"libc",
"uucore",
"winapi 0.3.9",
"winapi",
]
[[package]]
@ -2270,7 +2220,7 @@ dependencies = [
"clap 3.2.17",
"glob",
"uucore",
"winapi 0.3.9",
"winapi",
]
[[package]]
@ -2400,7 +2350,7 @@ dependencies = [
"clap 3.2.17",
"hostname",
"uucore",
"winapi 0.3.9",
"winapi",
]
[[package]]
@ -2480,7 +2430,7 @@ dependencies = [
"once_cell",
"selinux",
"term_grid",
"termsize",
"terminal_size",
"unicode-width",
"uucore",
]
@ -2702,7 +2652,7 @@ dependencies = [
"remove_dir_all 0.7.0",
"uucore",
"walkdir",
"winapi 0.3.9",
"winapi",
]
[[package]]
@ -2844,7 +2794,7 @@ dependencies = [
"clap 3.2.17",
"libc",
"uucore",
"winapi 0.3.9",
"winapi",
]
[[package]]
@ -2867,7 +2817,7 @@ dependencies = [
"nix",
"notify",
"uucore",
"winapi 0.3.9",
"winapi",
"winapi-util",
]
@ -2909,7 +2859,7 @@ dependencies = [
"filetime",
"time",
"uucore",
"winapi 0.3.9",
"winapi",
]
[[package]]
@ -3046,7 +2996,7 @@ dependencies = [
"clap 3.2.17",
"libc",
"uucore",
"winapi 0.3.9",
"winapi",
]
[[package]]
@ -3079,7 +3029,7 @@ dependencies = [
"uucore_procs",
"walkdir",
"wild",
"winapi 0.3.9",
"winapi",
"winapi-util",
"z85",
]
@ -3117,7 +3067,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56"
dependencies = [
"same-file",
"winapi 0.3.9",
"winapi",
"winapi-util",
]
@ -3201,12 +3151,6 @@ dependencies = [
"glob",
]
[[package]]
name = "winapi"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
[[package]]
name = "winapi"
version = "0.3.9"
@ -3217,12 +3161,6 @@ dependencies = [
"winapi-x86_64-pc-windows-gnu",
]
[[package]]
name = "winapi-build"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
[[package]]
name = "winapi-i686-pc-windows-gnu"
version = "0.4.0"
@ -3235,7 +3173,7 @@ version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
dependencies = [
"winapi 0.3.9",
"winapi",
]
[[package]]

View file

@ -20,7 +20,7 @@ clap = { version = "3.2", features = ["wrap_help", "cargo", "env"] }
unicode-width = "0.1.8"
number_prefix = "0.4"
term_grid = "0.1.5"
termsize = "0.1.6"
terminal_size = "0.1"
glob = "0.3.0"
lscolors = { version = "0.12.0", features = ["ansi_term"] }
uucore = { version=">=0.0.15", package="uucore", path="../../uucore", features = ["entries", "fs"] }

View file

@ -588,8 +588,8 @@ impl Config {
}
}
}
None => match termsize::get() {
Some(size) => size.cols,
None => match terminal_size::terminal_size() {
Some((width, _)) => width.0,
None => match std::env::var_os("COLUMNS") {
Some(columns) => match columns.to_str().and_then(|s| s.parse().ok()) {
Some(columns) => columns,