feat(cli): respect NO_COLOR environment variable in REPL banner#310
Open
superjackche wants to merge 1 commit into
Open
feat(cli): respect NO_COLOR environment variable in REPL banner#310superjackche wants to merge 1 commit into
superjackche wants to merge 1 commit into
Conversation
Add support for the standard NO_COLOR convention (https://no-color.org/) in the REPL banner color detection. When NO_COLOR is set, the banner and all styled output are disabled regardless of TTY capabilities.
|
@superjackche is attempting to deploy a commit to the Dystr Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Pull request overview
Adds support for the standard NO_COLOR environment variable to disable color/styling in the REPL banner output, overriding TTY-based color detection.
Changes:
- Detects
NO_COLORand disables decorated output when it’s set. - Keeps existing
stdoutTTY detection andTERM=dumbhandling intact.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
gneeri
reviewed
Apr 27, 2026
| } | ||
|
|
||
| fn detect_banner_capabilities() -> BannerCapabilities { | ||
| let decorated = atty::is(atty::Stream::Stdout) |
Contributor
There was a problem hiding this comment.
Thanks for submitting this update. That said, I believe that supports_color (below ln 147/9) already handles the NO_COLOR env var. Can you confirm that this is NOT the case.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add support for the standard
NO_COLORconvention in the REPL banner color detection.When
NO_COLORis set (to any value), the REPL banner and all styled output are disabled regardless of TTY capabilities.Changes
crates/runmat-cli/src/commands/repl.rs:NO_COLORenvironment variable check indetect_banner_capabilities()TERM=dumband non-TTY detection logicChecklist
maincargo fmtpassescargo check -p runmatpasses