Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Make usable without atty. #134

Closed
wants to merge 0 commits into from

Conversation

shanecelis
Copy link

I'm thinking about using this crate with bevy for doing colored text without any tty in sight. This merely adds a feature 'tty' that is by default on, so no change unless opted-in.

@hwittenborn hwittenborn force-pushed the master branch 3 times, most recently from 744b5dd to 1921f20 Compare July 3, 2023 11:42
src/control.rs Outdated
Comment on lines 106 to 112
#[allow(unused_mut)]
let mut tty: Option<bool> = None;

#[cfg(feature = "tty")]
{
tty = Some(atty::is(atty::Stream::Stdout));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Option could just be removed, right?

        #[allow(unused_mut)]
        let mut tty = false;

        #[cfg(feature = "tty")]
        {
            tty = atty::is(atty::Stream::Stdout);
        }

@hwittenborn
Copy link
Member

Ignore the CI failing, that's due to all the features not being enabled. I'll get that fix shortly.

@hwittenborn
Copy link
Member

Hey, @shanecelis, I've gone ahead and replaced atty with is-terminal in the latest release because of #131. If you could get this PR moved over to that I'd still be more than glad to accept it :)

@shanecelis
Copy link
Author

Great. Will do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants