TUI: low-contrast/invisible text on macOS dark terminal (worst when selecting to copy)

Aperta Adatta ai principianti
#121 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
typescript
Ambito
cli

Direzione di ricerca

Inizia in ui-tui/src/theme.ts, intorno alla definizione di DARK_16_COLORS, e confronta i suoi valori muted, label, sessionLabel e selectionBg con quelli dei livelli di tema superiori. Riproduci il caso di selezione nel terminale scuro descritto nell’issue, quindi verifica che il testo attenuato rimanga leggibile e che il testo selezionato non scompaia nei livelli della palette interessati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

On macOS dark terminals, some TUI text is very low contrast — and when you select it to copy, it becomes effectively invisible (dark-gray text on a dark-gray selection highlight).

Reported with a screenshot of an assistant prompt line (能否请您直接告诉我...) rendered so faintly it is barely readable, and unreadable once highlighted for copy.

Likely cause (code)

In the 16-color theme tier DARK_16_COLORS (ui-tui/src/theme.ts, ~L363), several foreground roles and the selection background all resolve to the same ansi:blackBright:

muted:       'ansi:blackBright'
label:       'ansi:blackBright'
sessionLabel:'ansi:blackBright'
selectionBg: 'ansi:blackBright'   // <- selection highlight
diffAdded:   'ansi:blackBright'
diffRemoved: 'ansi:blackBright'

Two problems on a dark background:

  1. ansi:blackBright (bright black ≈ dark gray) as a foreground is already very low contrast against a dark terminal bg → muted/label/dim text is hard to read.
  2. selectionBg is also ansi:blackBright, so selecting any dark/muted foreground text puts gray-on-gray → the text disappears while highlighted (matches "复制文案时看不出来").

The higher tiers (muted: '#858482' / ansi256(102) / ansi256(59)) are less severe but muted still trends low-contrast.

Steps to reproduce
  1. macOS, dark-background terminal (Terminal.app / iTitem2 dark).
  2. Launch raven TUI.
  3. Observe muted/secondary text (e.g. an assistant prompt / hint line) — low contrast.
  4. Click-drag to select that text to copy → it becomes invisible under the selection highlight.
Expected

Muted text stays legible on dark backgrounds, and selected text remains readable (selection highlight must contrast with the text it covers).

Suggested fix
  • Give selectionBg a background distinct from any foreground role (not ansi:blackBright), or invert selected-text foreground so it always contrasts.
  • Bump the muted/label foreground to a higher-contrast value on dark themes.
Info needed to pin the exact theme tier

Could the reporter share the terminal's echo "$TERM / $COLORTERM" and terminal app? That tells us whether they land on the 16-color tier (the worst case above) or a 256/truecolor tier, so the fix targets the right palette.

Environment

macOS, dark terminal. (Screenshot shows faint assistant text; attach if possible.)

Lingua principale
Python
Stelle
4.1k
Fork
94
Merge medio
1g 21h
PR unite (30g)
239

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di EverMind-AI/Raven

Tutte le issue di EverMind-AI/Raven

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.