Skip to content

Conversation

@HueCodes
Copy link

Adds automatic terminal background detection to improve banner visibility on light themes.

  • Uses terminal-light crate to detect terminal luminance
  • Light terminals get DarkBlue/DarkOrange colors instead of Green/Yellow
  • Falls back to dark theme if detection fails (backwards compatible)

Fixes #778

Fixes bee-san#778

The banner was hard to read on light terminal themes because it used
bright green and yellow colors designed for dark backgrounds.

Changes:
- Add terminal-light crate to detect terminal background luminance
- Add is_light_terminal() to detect light vs dark terminals
- Add banner_colors() to select appropriate colors per theme
- Light terminals now use DarkBlue/DarkOrange instead of Green/Yellow
- Falls back to dark theme colors if detection fails (preserving
  existing behavior)
- Add unit tests for color selection logic
Copy link
Contributor

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 automatic terminal background (luminance) detection to choose higher-contrast banner colors on light terminal themes, addressing the banner visibility complaint in #778.

Changes:

  • Introduces terminal luma detection with a threshold-based “light vs dark terminal” decision.
  • Switches banner/info gradient colors based on detected terminal theme (with dark-theme fallback on detection failure).
  • Adds unit tests for the light/dark color mapping and introduces the terminal-light dependency.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/main.rs Adds terminal luma detection and selects banner colors accordingly; adds tests for color selection.
Cargo.toml Adds terminal-light dependency to support background detection.
Cargo.lock Locks transitive dependencies pulled in by terminal-light (e.g., crossterm/xterm-query).

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

Adds stdout/stdin TTY checks before calling terminal_light::luma()
to prevent blocking or emitting control sequences in non-interactive
contexts (e.g., piped output, CI/CD).

Addresses Copilot's review feedback on PR bee-san#863.
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.

Banner not clearly visible in a light terminal, not really an issue

1 participant