Skip to content

Commit

Permalink
Replace unmaintained atty with is-terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
oxalica committed Jun 15, 2023
1 parent 119e56e commit 1edf2ad
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 24 deletions.
36 changes: 14 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/nil/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
3 changes: 2 additions & 1 deletion crates/nil/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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!(
"\
Expand Down

0 comments on commit 1edf2ad

Please sign in to comment.