Skip to content

fix: washed-out yellow on light-background terminals#1740

Open
joshazmy wants to merge 1 commit into
VirtusLab:developfrom
joshazmy:fix/washed-out-yellow-380
Open

fix: washed-out yellow on light-background terminals#1740
joshazmy wants to merge 1 commit into
VirtusLab:developfrom
joshazmy:fix/washed-out-yellow-380

Conversation

@joshazmy

@joshazmy joshazmy commented Jul 6, 2026

Copy link
Copy Markdown

Summary

FullTerminalAnsiOutputCodes.YELLOW used plain SGR 33 ("dark yellow"), which renders as a washed-out, barely-visible color on light/white terminal backgrounds. This color was already fixed once, to the brighter 256-color gold1 (\033[00;38;5;220m), in 0b43361 ("Improved visibility on white terminal backgrounds"), but got silently overwritten back to plain SGR 33 by 21f9b8a, which was actually only trying to match a different yellow use (the hook-ignored-hook hint) to git's own advice color.

This restores the 256-color gold1 for full-fledged terminals. 8-color terminals (BasicTerminalAnsiOutputCodes) can't render the 256-color escape, so they keep plain SGR 33 explicitly rather than inheriting the 256-color value.

Fixes #380

Test plan

  • Added test_yellow_is_not_the_washed_out_dark_yellow regression test in tests/test_utils.py
  • Ran tests/test_utils.py — 8 passed, 2 skipped (platform-specific, unrelated)
  • Ran the full color-related suite (test_status.py, test_discover.py, test_advance.py, test_fork_point.py, test_go_interactive.py, test_traverse.py) — all pass except 18 pre-existing failures unrelated to this change (verified: identical failures reproduce against unmodified develop, caused by shutil.copytree failing on a .git/fsmonitor--daemon.ipc unix socket in this sandbox, not by this fix)

FullTerminalAnsiOutputCodes.YELLOW used plain SGR 33 ("dark yellow"),
which renders as a washed-out, barely-visible color on light/white
terminal backgrounds. This color was already fixed once, to the
brighter 256-color gold1 (\033[00;38;5;220m), in 0b43361 ("Improved
visibility on white terminal backgrounds"), but got silently
overwritten back to plain SGR 33 by 21f9b8a, which was actually only
trying to match a *different* yellow use (the hook-ignored-hook hint)
to git's own advice color.

Restore the 256-color gold1 for full-fledged terminals. 8-color
terminals (BasicTerminalAnsiOutputCodes) can't render the 256-color
escape, so they keep plain SGR 33 explicitly rather than inheriting
the 256-color value.

Fixes VirtusLab#380
UNDERLINE = '\033[4m'
GREEN = '\033[32m'
YELLOW = '\033[33m'
# Plain SGR 33 ("dark yellow") renders as a washed-out, barely-visible color on light/white-background

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The "SGR" acronym isn't well-known, pls expand (at least in one place)

Comment on lines +91 to +93
# backgrounds; it was already used for exactly this reason back in 0b43361 ("Improved visibility on white
# terminal backgrounds"), but got silently overwritten by 21f9b8a while that commit was actually only
# trying to match a *different* yellow use (the hook-ignored-hook hint below) to git's own advice color.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Pls do not describe the historical state in the comments, just the current one (to reduce confusion/reduce mental load)

@PawelLipski

Copy link
Copy Markdown
Collaborator

Thanks for the contribution - could you actually attach the screens of before and after this change on your terminal?

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.

Does yellow edge really look yellow in white-background terminals?

2 participants