Skip to content

Commit

Permalink
Drop atty dep, use new std is_terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
osa1 committed Jun 1, 2023
1 parent 581c403 commit 59fbdc5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ repository = "https://github.com/osa1/sg"

[dependencies]
ansi_term = "0.12"
atty = "0.2.14"
clap = "2.33"
tree-sitter = "0.20.6"

Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::borrow::Cow;
use std::cell::RefCell;
use std::ffi::OsString;
use std::fs;
use std::io::Write;
use std::io::{IsTerminal, Write};
use std::path::Path;

use tree_sitter::{Language, Node, Parser};
Expand Down Expand Up @@ -122,7 +122,7 @@ where
}
};

if !nocolor && !assume_color_support && !atty::is(atty::Stream::Stdout) {
if !nocolor && !assume_color_support && !std::io::stdout().is_terminal() {
nocolor = true;
}

Expand Down

0 comments on commit 59fbdc5

Please sign in to comment.