Skip to content
Myr

Replace atty with std

Before adoption: this commit came in with the history the project adopted, so no landing records it.

std now has a function for testing if stdout is a tty

authored by Thayne McCombs · committed by Thayne McCombs · parent 91e3c3c · Browse files · 3 files+2 added−24 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+2 added−24 removed

  • other:+2 added−24 removed

3 files+2 added−24 removed

modified:src/main.rs+2 added-2 removed
10 unmodified lines
11mod regex_helper;12mod walk;1314use std::env;15use std::io::IsTerminal;16use std::path::Path;17use std::sync::Arc;18use std::time;1920use anyhow::{anyhow, bail, Context, Result};20use atty::Stream;21use clap::{CommandFactory, Parser};22use globset::GlobBuilder;23use lscolors::LsColors;24use regex::bytes::{Regex, RegexBuilder, RegexSetBuilder};
191 unmodified lines
216 nu_ansi_term::enable_ansi_support().is_ok() || std::env::var_os("TERM").is_some();217 #[cfg(not(windows))]218 let ansi_colors_support = true;219220 let interactive_terminal = atty::is(Stream::Stdout);220 let interactive_terminal = std::io::stdout().is_terminal();221 let colored_output = match opts.color {222 ColorWhen::Always => true,223 ColorWhen::Never => false,224 ColorWhen::Auto => {
247 unmodified lines
modified:Cargo.lock-21 removed
36 unmodified lines
37 "nix 0.24.3",38]3940[[package]]41name = "atty"42version = "0.2.14"43source = "registry+https://github.com/rust-lang/crates.io-index"44checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"45dependencies = [46 "hermit-abi 0.1.19",47 "libc",48 "winapi",49]5051[[package]]41name = "autocfg"42version = "1.1.0"43source = "registry+https://github.com/rust-lang/crates.io-index"44checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
270 unmodified lines
315version = "8.7.0"316dependencies = [317 "anyhow",318 "argmax",330 "atty",319 "chrono",320 "clap",321 "clap_complete",322 "crossbeam-channel",
69 unmodified lines
392checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"393394[[package]]395name = "hermit-abi"408version = "0.1.19"409source = "registry+https://github.com/rust-lang/crates.io-index"410checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"411dependencies = [412 "libc",413]414415[[package]]416name = "hermit-abi"396version = "0.2.6"397source = "registry+https://github.com/rust-lang/crates.io-index"398checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7"399dependencies = [
784 unmodified lines
modified:Cargo.toml-1 removed