summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
Diffstat (limited to 'cli')
-rw-r--r--cli/Cargo.toml1
-rw-r--r--cli/cache/cache_db.rs3
-rw-r--r--cli/tools/upgrade.rs3
-rw-r--r--cli/util/draw_thread.rs3
-rw-r--r--cli/util/file_watcher.rs3
5 files changed, 8 insertions, 5 deletions
diff --git a/cli/Cargo.toml b/cli/Cargo.toml
index b3a6939ac..91ccebf71 100644
--- a/cli/Cargo.toml
+++ b/cli/Cargo.toml
@@ -62,7 +62,6 @@ eszip = "=0.50.0"
napi_sym.workspace = true
async-trait.workspace = true
-atty.workspace = true
base32 = "=0.4.0"
base64.workspace = true
bincode = "=1.3.3"
diff --git a/cli/cache/cache_db.rs b/cli/cache/cache_db.rs
index 9b591f58a..b6b4d074e 100644
--- a/cli/cache/cache_db.rs
+++ b/cli/cache/cache_db.rs
@@ -9,6 +9,7 @@ use deno_runtime::deno_webstorage::rusqlite::Connection;
use deno_runtime::deno_webstorage::rusqlite::OptionalExtension;
use deno_runtime::deno_webstorage::rusqlite::Params;
use once_cell::sync::OnceCell;
+use std::io::IsTerminal;
use std::path::PathBuf;
use std::sync::Arc;
@@ -261,7 +262,7 @@ impl CacheDB {
};
// Failed, try deleting it
- let is_tty = atty::is(atty::Stream::Stderr);
+ let is_tty = std::io::stderr().is_terminal();
log::log!(
if is_tty { log::Level::Warn } else { log::Level::Trace },
"Could not initialize cache database '{}', deleting and retrying... ({err:?})",
diff --git a/cli/tools/upgrade.rs b/cli/tools/upgrade.rs
index bef4538b3..c0fbb73ce 100644
--- a/cli/tools/upgrade.rs
+++ b/cli/tools/upgrade.rs
@@ -23,6 +23,7 @@ use once_cell::sync::Lazy;
use std::borrow::Cow;
use std::env;
use std::fs;
+use std::io::IsTerminal;
use std::ops::Sub;
use std::path::Path;
use std::path::PathBuf;
@@ -210,7 +211,7 @@ pub fn check_for_upgrades(
// Print a message if an update is available
if let Some(upgrade_version) = update_checker.should_prompt() {
- if log::log_enabled!(log::Level::Info) && atty::is(atty::Stream::Stderr) {
+ if log::log_enabled!(log::Level::Info) && std::io::stderr().is_terminal() {
if version::is_canary() {
eprint!(
"{} ",
diff --git a/cli/util/draw_thread.rs b/cli/util/draw_thread.rs
index 832c7f74b..352ead3b0 100644
--- a/cli/util/draw_thread.rs
+++ b/cli/util/draw_thread.rs
@@ -5,6 +5,7 @@ use deno_core::parking_lot::Mutex;
use deno_core::unsync::spawn_blocking;
use deno_runtime::ops::tty::ConsoleSize;
use once_cell::sync::Lazy;
+use std::io::IsTerminal;
use std::sync::Arc;
use std::time::Duration;
@@ -70,7 +71,7 @@ static INTERNAL_STATE: Lazy<Arc<Mutex<InternalState>>> = Lazy::new(|| {
});
static IS_TTY_WITH_CONSOLE_SIZE: Lazy<bool> = Lazy::new(|| {
- atty::is(atty::Stream::Stderr)
+ std::io::stderr().is_terminal()
&& console_size()
.map(|s| s.cols > 0 && s.rows > 0)
.unwrap_or(false)
diff --git a/cli/util/file_watcher.rs b/cli/util/file_watcher.rs
index ddeedb741..c0eda2d86 100644
--- a/cli/util/file_watcher.rs
+++ b/cli/util/file_watcher.rs
@@ -16,6 +16,7 @@ use notify::RecommendedWatcher;
use notify::RecursiveMode;
use notify::Watcher;
use std::collections::HashSet;
+use std::io::IsTerminal;
use std::path::PathBuf;
use std::sync::Arc;
use std::time::Duration;
@@ -98,7 +99,7 @@ pub struct PrintConfig {
fn create_print_after_restart_fn(clear_screen: bool) -> impl Fn() {
move || {
- if clear_screen && atty::is(atty::Stream::Stderr) {
+ if clear_screen && std::io::stderr().is_terminal() {
eprint!("{CLEAR_SCREEN}");
}
info!(