Use is-terminal crate for now (#9670)

# Description
Until we bump our minimal Rust version to `1.70.0` we can't use
`std::io::IsTerminal`. The crate `is-terminal` (depending on `rustix` or
`windows-sys`) can provide the same.
Get's rid of the dependency on the outdated `atty` crate.
We already transitively depend on it (e.g. through `miette`)

As soon as we reach the new Rust version we can supersede this with
@nibon7's #9550

Co-authored-by: nibon7 <nibon7@163.com>
This commit is contained in:
Stefan Holderbach
2023-07-12 18:15:54 +02:00
committed by GitHub
parent 026335fff0
commit 39b43d1e4b
9 changed files with 22 additions and 50 deletions

View File

@ -1,8 +1,9 @@
#[cfg(unix)]
pub(crate) fn acquire_terminal(interactive: bool) {
use is_terminal::IsTerminal;
use nix::sys::signal::{signal, SigHandler, Signal};
if !atty::is(atty::Stream::Stdin) {
if !std::io::stdin().is_terminal() {
return;
}