cloudposse / cloudposse/atmos

Atmos error output is unreadable on terminal with white background

Open
#1,184 2 comments 3 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
1.4k
Forks
175
Avg merge
2d 3h
Merged PRs (30d)
134

Description

### Describe the Bug

Atmos outputs colored text by default. However, it currently assumes the terminal has a dark background, and outputs white error text. This is illegible on a standard "light mode" terminal with a white background. Atmos should default to showing output in colors that contrast with the background, and not use colored output (just use default terminal foreground and background colors) if it cannot determine the background color.

Colored text is nice, but legibility is more important. Users should not have to take any action for the output of Atmos to be legible.

### Expected Behavior

Any output text, colored or not, should, by default, meet the [WCAG minimum contrast criterion](https://www.w3.org/TR/WCAG22/#contrast-minimum), unless users specifically configure Atmos otherwise.

This includes supporting users who use light mode some of the time (e.g. daytime) and dark mode at other times (e.g. nighttime).

### Steps to Reproduce

1. Use a terminal that supports color. I use `TERM=xterm-256color` but you can probably use other color modes, including full color.
2. Set the terminal to dark text on a white background.
3. Run `atmos error`
4. Try to read the error message

### Screenshots

![Image](https://github.com/user-attachments/assets/86de30be-fcf2-4d40-b4c9-8cb2893ec6e8)

The last line of text, "the flag '--component' is passed, but the component is not defin..." is only legible at all because the background is tinted. If it were white, it would be completely illegible.

### Environment

Atmos 1.169.0

### Additional Context

## Web Content Accessibility Guidelines (WCAG) 2.2
- [WCAG minimum contrast criterion](https://www.w3.org/TR/WCAG22/#contrast-minimum)
- [Understanding Contrast (Minimum)](https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html)
- [How to Meet Contrast (Minimum)](https://www.w3.org/WAI/WCAG22/quickref/#contrast-minimum)

Contributor guide

Open the contributing guide

Research direction

Start at the `atmos error` CLI entry point and trace how colored output is selected. Reproduce the output on light and dark terminals, then verify that it meets the WCAG contrast requirement or falls back to terminal defaults when the background cannot be determined.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
accessibility, cli
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.