diff --git a/Cargo.lock b/Cargo.lock index 8becfc8a57a0..ebcbbb9a5cdf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2543,7 +2543,6 @@ dependencies = [ "criterion", "crossterm", "ctrlc", - "is-terminal", "log", "miette", "mimalloc", @@ -2609,7 +2608,6 @@ dependencies = [ "crossterm", "fancy-regex", "fuzzy-matcher", - "is-terminal", "is_executable", "log", "miette", @@ -2740,7 +2738,6 @@ dependencies = [ "indexmap 2.0.0", "indicatif", "is-root", - "is-terminal", "itertools", "libc", "log", @@ -2942,7 +2939,6 @@ name = "nu-system" version = "0.82.1" dependencies = [ "chrono", - "is-terminal", "libc", "libproc", "log", diff --git a/Cargo.toml b/Cargo.toml index 145b1361d120..c800b9539dea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,7 +94,6 @@ nix = { version = "0.26", default-features = false, features = [ "fs", "term", ] } -is-terminal = "0.4.8" [dev-dependencies] nu-test-support = { path = "./crates/nu-test-support", version = "0.82.1" } diff --git a/crates/nu-cli/Cargo.toml b/crates/nu-cli/Cargo.toml index 43354825cf76..982e1ac3c790 100644 --- a/crates/nu-cli/Cargo.toml +++ b/crates/nu-cli/Cargo.toml @@ -32,7 +32,6 @@ crossterm = "0.26" fancy-regex = "0.11" fuzzy-matcher = "0.3" is_executable = "1.0" -is-terminal = "0.4.8" log = "0.4" miette = { version = "5.9", features = ["fancy-no-backtrace"] } once_cell = "1.18" diff --git a/crates/nu-cli/src/repl.rs b/crates/nu-cli/src/repl.rs index 9294d6454866..e62c022fc6a3 100644 --- a/crates/nu-cli/src/repl.rs +++ b/crates/nu-cli/src/repl.rs @@ -6,7 +6,6 @@ use crate::{ NuHighlighter, NuValidator, NushellPrompt, }; use crossterm::cursor::SetCursorStyle; -use is_terminal::IsTerminal; use log::{trace, warn}; use miette::{ErrReport, IntoDiagnostic, Result}; use nu_cmd_base::util::get_guaranteed_cwd; @@ -26,7 +25,7 @@ use reedline::{ SqliteBackedHistory, Vi, }; use std::{ - io::{self, Write}, + io::{self, IsTerminal, Write}, path::Path, sync::atomic::Ordering, time::Instant, diff --git a/crates/nu-command/Cargo.toml b/crates/nu-command/Cargo.toml index cf67d2cdf439..0eded1236e79 100644 --- a/crates/nu-command/Cargo.toml +++ b/crates/nu-command/Cargo.toml @@ -51,7 +51,6 @@ htmlescape = "0.3" indexmap = "2.0" indicatif = "0.17" is-root = "0.1" -is-terminal = "0.4.8" itertools = "0.10" log = "0.4" lscolors = { version = "0.14", default-features = false, features = ["nu-ansi-term"] } diff --git a/crates/nu-command/src/viewers/table.rs b/crates/nu-command/src/viewers/table.rs index b41e290dedcb..a9d26058e5f9 100644 --- a/crates/nu-command/src/viewers/table.rs +++ b/crates/nu-command/src/viewers/table.rs @@ -1,4 +1,3 @@ -use is_terminal::IsTerminal; use lscolors::{LsColors, Style}; use nu_color_config::color_from_hex; use nu_color_config::{StyleComputer, TextStyle}; @@ -14,6 +13,7 @@ use nu_table::{ TableConfig, TableOutput, TableTheme, }; use nu_utils::get_ls_colors; +use std::io::IsTerminal; use std::sync::Arc; use std::time::Instant; use std::{path::PathBuf, sync::atomic::AtomicBool}; diff --git a/crates/nu-system/Cargo.toml b/crates/nu-system/Cargo.toml index b25de6f2b809..27a7d15d6e22 100644 --- a/crates/nu-system/Cargo.toml +++ b/crates/nu-system/Cargo.toml @@ -18,7 +18,6 @@ log = "0.4" [target.'cfg(target_family = "unix")'.dependencies] nix = { version = "0.26", default-features = false, features = ["fs", "term", "process", "signal"]} -is-terminal = "0.4.8" [target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies] procfs = "0.15" diff --git a/crates/nu-system/src/foreground.rs b/crates/nu-system/src/foreground.rs index af2265b98184..47530afb5607 100644 --- a/crates/nu-system/src/foreground.rs +++ b/crates/nu-system/src/foreground.rs @@ -82,11 +82,11 @@ impl Drop for ForegroundChild { // Note: we exclude macos because the techniques below seem to have issues in macos 13 currently. #[cfg(all(target_family = "unix", not(target_os = "macos")))] mod fg_process_setup { - use is_terminal::IsTerminal; use nix::{ sys::signal, unistd::{self, Pid}, }; + use std::io::IsTerminal; use std::os::unix::prelude::{CommandExt, RawFd}; // TODO: when raising MSRV past 1.63.0, switch to OwnedFd diff --git a/src/terminal.rs b/src/terminal.rs index 6d20299fbb1b..616c21330e36 100644 --- a/src/terminal.rs +++ b/src/terminal.rs @@ -1,7 +1,7 @@ #[cfg(unix)] pub(crate) fn acquire_terminal(interactive: bool) { - use is_terminal::IsTerminal; use nix::sys::signal::{signal, SigHandler, Signal}; + use std::io::IsTerminal; if !std::io::stdin().is_terminal() { return;