From 2cb35e25441c8ec1bb50054c2575cbd668dfee42 Mon Sep 17 00:00:00 2001 From: Richard Petrie Date: Sat, 9 Feb 2019 06:29:02 -0500 Subject: [PATCH] Replace deprecated 'isatty' with 'atty'. --- core/lib/Cargo.toml | 2 +- core/lib/src/lib.rs | 2 +- core/lib/src/logger.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/lib/Cargo.toml b/core/lib/Cargo.toml index 19b9337f..7a84b09d 100644 --- a/core/lib/Cargo.toml +++ b/core/lib/Cargo.toml @@ -34,7 +34,7 @@ time = "0.1" memchr = "2" # TODO: Use pear instead. base64 = "0.10" pear = "0.1" -isatty = "0.1" +atty = "0.2" [build-dependencies] yansi = "0.5" diff --git a/core/lib/src/lib.rs b/core/lib/src/lib.rs index e0c9f6df..e676d989 100644 --- a/core/lib/src/lib.rs +++ b/core/lib/src/lib.rs @@ -111,7 +111,7 @@ extern crate state; extern crate time; extern crate memchr; extern crate base64; -extern crate isatty; +extern crate atty; #[cfg(test)] #[macro_use] extern crate lazy_static; diff --git a/core/lib/src/logger.rs b/core/lib/src/logger.rs index 031f800b..bd31d681 100644 --- a/core/lib/src/logger.rs +++ b/core/lib/src/logger.rs @@ -150,7 +150,7 @@ crate fn try_init(level: LoggingLevel, verbose: bool) -> bool { return false; } - if !::isatty::stdout_isatty() + if !::atty::is(::atty::Stream::Stdout) || (cfg!(windows) && !Paint::enable_windows_ascii()) || env::var_os(COLORS_ENV).map(|v| v == "0" || v == "off").unwrap_or(false) {