Skip to content

Allow disabling colors via anstream#256

Merged
tertsdiepraam merged 1 commit intomainfrom
disable-color-the-stupid-way
Oct 21, 2025
Merged

Allow disabling colors via anstream#256
tertsdiepraam merged 1 commit intomainfrom
disable-color-the-stupid-way

Conversation

@tertsdiepraam
Copy link
Contributor

@tertsdiepraam tertsdiepraam commented Oct 20, 2025

Closes #243

Use anstream to disable terminal colors automagically. I made the regular println and eprintln disallowed in clippy so that we are forced to use the anstream versions. This required me to make my own wrappers that call the anstream macros with an #[allow(clippy::disallowed_macros)], because they expand to something that calls println/eprintln.

Note that anstream is already in our dependency tree via clap.

@tertsdiepraam tertsdiepraam requested a review from bal-e October 20, 2025 12:32
Copy link
Contributor

@bal-e bal-e left a comment

Choose a reason for hiding this comment

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

Looks good! Unrelated note: at some point we probably want to separate the CLI and the daemon into properly independent crates.

@tertsdiepraam tertsdiepraam force-pushed the disable-color-the-stupid-way branch 2 times, most recently from faf435b to 3238fa6 Compare October 20, 2025 12:59
@tertsdiepraam tertsdiepraam force-pushed the disable-color-the-stupid-way branch from 3238fa6 to 9f031a6 Compare October 20, 2025 14:29
@tertsdiepraam tertsdiepraam merged commit eac3099 into main Oct 21, 2025
27 checks passed
@tertsdiepraam tertsdiepraam deleted the disable-color-the-stupid-way branch November 24, 2025 10:30
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.

cascade status uses colors in spite of !isatty() and TERM=dumb

2 participants