diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:44 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:44 +0000 |
commit | c23a457e72abe608715ac76f076f47dc42af07a5 (patch) | |
tree | 2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /vendor/terminal_size | |
parent | Releasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip |
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/terminal_size')
-rw-r--r-- | vendor/terminal_size/.cargo-checksum.json | 2 | ||||
-rw-r--r-- | vendor/terminal_size/Cargo.lock | 121 | ||||
-rw-r--r-- | vendor/terminal_size/Cargo.toml | 6 | ||||
-rw-r--r-- | vendor/terminal_size/README.md | 2 | ||||
-rw-r--r-- | vendor/terminal_size/src/lib.rs | 4 | ||||
-rw-r--r-- | vendor/terminal_size/src/unix.rs | 18 | ||||
-rw-r--r-- | vendor/terminal_size/src/windows.rs | 28 |
7 files changed, 67 insertions, 114 deletions
diff --git a/vendor/terminal_size/.cargo-checksum.json b/vendor/terminal_size/.cargo-checksum.json index 8d851582d..4208507e1 100644 --- a/vendor/terminal_size/.cargo-checksum.json +++ b/vendor/terminal_size/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.lock":"2c75b0cb1b342f6ccca2ba358eef6c4f934890e553f546ccf338f035e5f49389","Cargo.toml":"2e27df36a2903b5a6fc4afe68ca5b03abf25c88927f7bd6d987782c263b6373e","LICENSE-APACHE":"c6596eb7be8581c18be736c846fb9173b69eccf6ef94c5135893ec56bd92ba08","LICENSE-MIT":"bc8dcbbd559a61b8a8c0c89d5c3e15d0dc47c6fae94e78ac428d6a7b7da3c4f9","README.md":"0043c89f8f64fd70d1b90b987844b41be44aceef2553cb5a2f0bd8959e22a55f","examples/get_size.rs":"17d78faa2baba7377eabc4a1737ea12adaee484fd6f86319809b2c70d34bf9c7","src/lib.rs":"5b754f981fbc2fb13ccb3566033eb64e98120dda2bbd158a7a1c8f57488251b6","src/unix.rs":"dbf2c89aeb581ba1c84cb4b7e6ee145f8c3b116e83d9f2b04ae1627da13d6a3a","src/windows.rs":"e68862cfbe69f110e12ed2a82ab77dd80ba848bcbbcd285e271a0de85f330b58"},"package":"8e6bf6f19e9f8ed8d4048dc22981458ebcf406d67e94cd422e5ecd73d63b3237"}
\ No newline at end of file +{"files":{"Cargo.lock":"3cc2480540bd8e6c6c6a2cdf953e81832517f46fc61234683ef43957f038b632","Cargo.toml":"c21e7e15fbc9b849476e4c016d503ae5360f2f9c4a3b40d392f18b0178a2bb89","LICENSE-APACHE":"c6596eb7be8581c18be736c846fb9173b69eccf6ef94c5135893ec56bd92ba08","LICENSE-MIT":"bc8dcbbd559a61b8a8c0c89d5c3e15d0dc47c6fae94e78ac428d6a7b7da3c4f9","README.md":"9182a961985e6c377250799be6cd37f9524f1c7e286e502b13abecc098ad14bc","examples/get_size.rs":"17d78faa2baba7377eabc4a1737ea12adaee484fd6f86319809b2c70d34bf9c7","src/lib.rs":"1552eb9a916df2c26beb581bdf15ebe51e236fdf301f64d70c1a691d10493a7b","src/unix.rs":"4afdf440ede9a639f1429cab848693ca298cf30ae3533a77acd4f534f3108b01","src/windows.rs":"4233393b0718cca31c761f7aa623f239c6892e7b91f0e75cc78f4b1f31cfabd9"},"package":"21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7"}
\ No newline at end of file diff --git a/vendor/terminal_size/Cargo.lock b/vendor/terminal_size/Cargo.lock index 69b00769c..86c34a0c3 100644 --- a/vendor/terminal_size/Cargo.lock +++ b/vendor/terminal_size/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "bitflags" -version = "1.3.2" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" [[package]] name = "cc" @@ -16,13 +16,13 @@ checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" [[package]] name = "errno" -version = "0.3.0" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d6a0976c999d473fe89ad888d5a284e55366d9dc9038b1ba2aa15128c4afa0" +checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" dependencies = [ "errno-dragonfly", "libc", - "windows-sys 0.45.0", + "windows-sys", ] [[package]] @@ -36,56 +36,36 @@ dependencies = [ ] [[package]] -name = "io-lifetimes" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1abeb7a0dd0f8181267ff8adc397075586500b81b28a73e8a0208b00fc170fb3" -dependencies = [ - "libc", - "windows-sys 0.45.0", -] - -[[package]] name = "libc" -version = "0.2.140" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "linux-raw-sys" -version = "0.3.1" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59d8c75012853d2e872fb56bc8a2e53718e2cafe1a4c823143141c6d90c322f" +checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" [[package]] name = "rustix" -version = "0.37.6" +version = "0.38.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d097081ed288dfe45699b72f5b5d648e5f15d64d900c7080273baa20c16a6849" +checksum = "c0c3dde1fc030af041adc40e79c0e7fbcf431dd24870053d187d7c66e4b87453" dependencies = [ "bitflags", "errno", - "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys 0.45.0", + "windows-sys", ] [[package]] name = "terminal_size" -version = "0.2.6" +version = "0.3.0" dependencies = [ "rustix", - "windows-sys 0.48.0", -] - -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.1", + "windows-sys", ] [[package]] @@ -94,22 +74,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.0", -] - -[[package]] -name = "windows-targets" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" -dependencies = [ - "windows_aarch64_gnullvm 0.42.1", - "windows_aarch64_msvc 0.42.1", - "windows_i686_gnu 0.42.1", - "windows_i686_msvc 0.42.1", - "windows_x86_64_gnu 0.42.1", - "windows_x86_64_gnullvm 0.42.1", - "windows_x86_64_msvc 0.42.1", + "windows-targets", ] [[package]] @@ -118,95 +83,53 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" - -[[package]] -name = "windows_aarch64_gnullvm" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" [[package]] name = "windows_aarch64_msvc" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" - -[[package]] -name = "windows_aarch64_msvc" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" [[package]] name = "windows_i686_gnu" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" - -[[package]] -name = "windows_i686_gnu" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" [[package]] name = "windows_i686_msvc" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" - -[[package]] -name = "windows_i686_msvc" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" [[package]] name = "windows_x86_64_gnu" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" - -[[package]] -name = "windows_x86_64_gnu" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" - -[[package]] -name = "windows_x86_64_gnullvm" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" [[package]] name = "windows_x86_64_msvc" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" - -[[package]] -name = "windows_x86_64_msvc" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" diff --git a/vendor/terminal_size/Cargo.toml b/vendor/terminal_size/Cargo.toml index 9f3116418..f810025e6 100644 --- a/vendor/terminal_size/Cargo.toml +++ b/vendor/terminal_size/Cargo.toml @@ -10,9 +10,9 @@ # See Cargo.toml.orig for the original contents. [package] -edition = "2018" +edition = "2021" name = "terminal_size" -version = "0.2.6" +version = "0.3.0" authors = ["Andrew Chin <achin@eminence32.net>"] description = "Gets the size of your Linux or Windows terminal" documentation = "https://docs.rs/crate/terminal_size" @@ -28,7 +28,7 @@ license = "MIT OR Apache-2.0" repository = "https://github.com/eminence/terminal-size" [target."cfg(not(windows))".dependencies.rustix] -version = "0.37.0" +version = "0.38.0" features = ["termios"] [target."cfg(windows)".dependencies.windows-sys] diff --git a/vendor/terminal_size/README.md b/vendor/terminal_size/README.md index 725723355..30e8872b8 100644 --- a/vendor/terminal_size/README.md +++ b/vendor/terminal_size/README.md @@ -22,7 +22,7 @@ if let Some((Width(w), Height(h))) = size { ## Minimum Rust Version -This crate requires a minimum rust version of 1.48.0 (2020-11-19) +This crate requires a minimum rust version of 1.63.0 (2022-08-11) ## License diff --git a/vendor/terminal_size/src/lib.rs b/vendor/terminal_size/src/lib.rs index e933b2140..6f8990cf1 100644 --- a/vendor/terminal_size/src/lib.rs +++ b/vendor/terminal_size/src/lib.rs @@ -34,4 +34,6 @@ mod windows; pub use crate::windows::{terminal_size, terminal_size_using_handle}; #[cfg(not(any(unix, windows)))] -pub fn terminal_size() -> Option<(Width, Height)> { None } +pub fn terminal_size() -> Option<(Width, Height)> { + None +} diff --git a/vendor/terminal_size/src/unix.rs b/vendor/terminal_size/src/unix.rs index 59af979d0..5fc7256e7 100644 --- a/vendor/terminal_size/src/unix.rs +++ b/vendor/terminal_size/src/unix.rs @@ -1,12 +1,22 @@ use super::{Height, Width}; +use rustix::fd::{BorrowedFd, AsRawFd}; use std::os::unix::io::RawFd; -use rustix::fd::BorrowedFd; -/// Returns the size of the terminal defaulting to STDOUT, if available. +/// Returns the size of the terminal. /// -/// If STDOUT is not a tty, returns `None` +/// This function checks the stdout, stderr, and stdin streams (in that order). +/// The size of the first stream that is a TTY will be returned. If nothing +/// is a TTY, then `None` is returned. pub fn terminal_size() -> Option<(Width, Height)> { - terminal_size_using_fd(rustix::io::raw_stdout()) + if let Some(size) = terminal_size_using_fd(std::io::stdout().as_raw_fd()) { + Some(size) + } else if let Some(size) = terminal_size_using_fd(std::io::stderr().as_raw_fd()) { + Some(size) + } else if let Some(size) = terminal_size_using_fd(std::io::stdin().as_raw_fd()) { + Some(size) + } else { + None + } } /// Returns the size of the terminal using the given file descriptor, if available. diff --git a/vendor/terminal_size/src/windows.rs b/vendor/terminal_size/src/windows.rs index 74315d6ab..ff98b868f 100644 --- a/vendor/terminal_size/src/windows.rs +++ b/vendor/terminal_size/src/windows.rs @@ -1,16 +1,34 @@ use super::{Height, Width}; use std::os::windows::io::RawHandle; -/// Returns the size of the terminal defaulting to STDOUT, if available. +/// Returns the size of the terminal. +/// +/// This function checks the stdout, stderr, and stdin streams (in that order). +/// The size of the first stream that is a TTY will be returned. If nothing +/// is a TTY, then `None` is returned. /// /// Note that this returns the size of the actual command window, and /// not the overall size of the command window buffer pub fn terminal_size() -> Option<(Width, Height)> { - use windows_sys::Win32::System::Console::{GetStdHandle, STD_OUTPUT_HANDLE}; - - let handle = unsafe { GetStdHandle(STD_OUTPUT_HANDLE) as RawHandle }; + use windows_sys::Win32::System::Console::{ + GetStdHandle, STD_ERROR_HANDLE, STD_INPUT_HANDLE, STD_OUTPUT_HANDLE, + }; - terminal_size_using_handle(handle) + if let Some(size) = + terminal_size_using_handle(unsafe { GetStdHandle(STD_OUTPUT_HANDLE) as RawHandle }) + { + Some(size) + } else if let Some(size) = + terminal_size_using_handle(unsafe { GetStdHandle(STD_ERROR_HANDLE) as RawHandle }) + { + Some(size) + } else if let Some(size) = + terminal_size_using_handle(unsafe { GetStdHandle(STD_INPUT_HANDLE) as RawHandle }) + { + Some(size) + } else { + None + } } /// Returns the size of the terminal using the given handle, if available. |