Skip to content

fix: add ansi colors for TTY support#348

Draft
andrinoff wants to merge 1 commit intofloatpane:masterfrom
andrinoff:fix/ansi-colors
Draft

fix: add ansi colors for TTY support#348
andrinoff wants to merge 1 commit intofloatpane:masterfrom
andrinoff:fix/ansi-colors

Conversation

@andrinoff
Copy link
Member

What?

Added explicit ANSI (8/16 color) fallbacks for theme colors that downsample poorly on Linux TTYs.

Why?

When running matcha on a real Linux TTY (which only supports 8/16 colors), bubbletea's automatic color downsampling produces unreadable results. Colors like 240, 241, 243 (used for secondary/muted text) all map to ANSI 8 (dark gray), which is invisible on a black TTY background. The tip color 214 (orange) maps to ANSI 9 (red), which is misleading.

This uses lipgloss.Complete() with colorprofile.Detect() to hand-pick readable ANSI fallbacks — light gray (7) for muted text, bright yellow (11) for tips/warnings, and red (1) for danger — while keeping the existing ANSI256/TrueColor values unchanged for normal terminal emulators.

Fixes #289

Signed-off-by: drew <me@andrinoff.com>
@github-actions github-actions bot added bug Something isn't working chore labels Mar 21, 2026
@andrinoff andrinoff changed the title chore: update flake.lock (#228) fix: add ansi colors for TTY support Mar 21, 2026
@andrinoff andrinoff removed the chore label Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bad colors using tmux in compose mail section

1 participant