From 76683334d648aba01d0f01ac7fef2ea27052704a Mon Sep 17 00:00:00 2001 From: Kai Ren Date: Fri, 24 Feb 2023 13:08:51 +0200 Subject: [PATCH] Replace unmaintained `atty` crate with `is-terminal` (#259, #260) Co-authored-by: Adam Charytoniuk --- Cargo.toml | 4 ++-- src/writer/out.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b99d4e5c..b01c278b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,8 +40,7 @@ timestamps = [] [dependencies] async-trait = "0.1.43" -atty = "0.2.14" -clap = { version = "4.0.6", features = ["derive", "wrap_help"] } +clap = { version = "4.0.27", features = ["derive", "wrap_help"] } console = "0.15" derive_more = { version = "0.99.17", features = ["as_ref", "deref", "deref_mut", "display", "error", "from", "into"], default_features = false } drain_filter_polyfill = "0.1.2" @@ -50,6 +49,7 @@ futures = "0.3.17" gherkin = "0.13" globwalk = "0.8.1" humantime = "2.1" +is-terminal = "0.4.4" itertools = "0.10" linked-hash-map = "0.5.3" once_cell = "1.13" diff --git a/src/writer/out.rs b/src/writer/out.rs index 99ee4e3e..fe4a7757 100644 --- a/src/writer/out.rs +++ b/src/writer/out.rs @@ -14,6 +14,7 @@ use std::{borrow::Cow, io, mem, str}; use console::Style; use derive_more::{Deref, DerefMut, Display, From, Into}; +use is_terminal::IsTerminal; use super::Coloring; @@ -53,8 +54,7 @@ impl Default for Styles { retry: Style::new().magenta(), header: Style::new().blue(), bold: Style::new().bold(), - is_present: atty::is(atty::Stream::Stdout) - && console::colors_enabled(), + is_present: io::stdout().is_terminal() && console::colors_enabled(), } } }