Skip to content

feat(cli): respect NO_COLOR environment variable in REPL banner#310

Open
superjackche wants to merge 1 commit into
runmat-org:mainfrom
superjackche:feat-no-color-support
Open

feat(cli): respect NO_COLOR environment variable in REPL banner#310
superjackche wants to merge 1 commit into
runmat-org:mainfrom
superjackche:feat-no-color-support

Conversation

@superjackche
Copy link
Copy Markdown

Summary

Add support for the standard NO_COLOR convention in the REPL banner color detection.

When NO_COLOR is 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:
    • Added NO_COLOR environment variable check in detect_banner_capabilities()
    • Preserves existing TERM=dumb and non-TTY detection logic

Checklist

  • Single logical change-set
  • Based on and targeted for main
  • No test changes required (follows existing env-var detection pattern)
  • cargo fmt passes
  • cargo check -p runmat passes

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.
Copilot AI review requested due to automatic review settings April 25, 2026 16:28
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 25, 2026

@superjackche is attempting to deploy a commit to the Dystr Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_COLOR and disables decorated output when it’s set.
  • Keeps existing stdout TTY detection and TERM=dumb handling intact.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gneeri gneeri self-requested a review April 27, 2026 16:15
}

fn detect_banner_capabilities() -> BannerCapabilities {
let decorated = atty::is(atty::Stream::Stdout)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

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.

3 participants