diff --git a/Cargo.lock b/Cargo.lock index 817c746..425b8a2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -57,17 +57,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - [[package]] name = "autocfg" version = "1.1.0" @@ -277,15 +266,6 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - [[package]] name = "hermit-abi" version = "0.3.1" @@ -355,11 +335,23 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.1", + "hermit-abi", "libc", "windows-sys 0.48.0", ] +[[package]] +name = "is-terminal" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +dependencies = [ + "hermit-abi", + "io-lifetimes", + "rustix", + "windows-sys 0.48.0", +] + [[package]] name = "itertools" version = "0.10.5" @@ -470,9 +462,9 @@ dependencies = [ "anyhow", "argh", "async-lsp", - "atty", "codespan-reporting", "ide", + "is-terminal", "log", "lsp-types", "nix-interop", diff --git a/crates/nil/Cargo.toml b/crates/nil/Cargo.toml index dc4f061..6f26890 100644 --- a/crates/nil/Cargo.toml +++ b/crates/nil/Cargo.toml @@ -9,9 +9,9 @@ rust-version.workspace = true anyhow = "1.0.68" argh = "0.1.10" async-lsp = "0.0.4" -atty = "0.2.14" codespan-reporting = "0.11.1" ide = { path = "../ide" } +is-terminal = "0.4.7" log = "0.4.17" lsp-types = "0.94.0" nix-interop = { path = "../nix-interop" } diff --git a/crates/nil/src/main.rs b/crates/nil/src/main.rs index f953575..8d25dd8 100644 --- a/crates/nil/src/main.rs +++ b/crates/nil/src/main.rs @@ -2,6 +2,7 @@ use anyhow::{Context, Result}; use argh::FromArgs; use codespan_reporting::term::termcolor::WriteColor; use ide::{AnalysisHost, Severity}; +use is_terminal::IsTerminal; use std::path::{Path, PathBuf}; use std::sync::Arc; use std::{env, fs, io, process}; @@ -85,7 +86,7 @@ fn main() { setup_logger(); - if !args.stdio && (atty::is(atty::Stream::Stdin) || atty::is(atty::Stream::Stdout)) { + if !args.stdio && (io::stdin().is_terminal() || io::stdout().is_terminal()) { // TODO: Make this a hard error. eprintln!( "\