Files
devvm/internal/msg
w3cjandClaude Opus 5.5 b94c99e226 feat(ui): color errors, warnings, doc links and log text in a terminal
devvm colors the labels and links around its messages with the
terminal's 16 base colors, so the theme picks shades that read on its
background; a message's own text stays in the default foreground.

- Die's devvm: label bold red (1;31), Warn's bold yellow (1;33)
- doc links underlined blue (4;34)
- Info's ==> bold (1)
- DieLogged's log end and its --- lines, and the status line's log
  text, dim (2), each line painted apart
- the done mark green (32)

No bright colors, backgrounds, 256 colors or truecolor, and no
background detection.

Each stream decides apart (colorOn): NO_COLOR or DEVVM_MESSAGES=names
off, then FORCE_COLOR or CLICOLOR_FORCE (but 0) on, then TERM=dumb off,
else only when that stream is a terminal. Names mode stays plain in a
terminal too, so e2e's checks under script read the names unchanged.
The run log and Stdout() data are never colored; no --color flag and no
message text changes.

internal/ui: a style per stream (style.go: paint, paintLines, message,
labelled, fit), made in onTerminal; Die and Warn share labelled. The
status line cuts and counts its plain text (style.fit) before painting,
so it fits and clears at the right width; statusText returns the log
part apart. Codes are added after printable() and msg.Shown.
internal/msg: M.Parts returns the text and the doc link apart, names and
no link in names mode; String joins them as before.

mise run test unsets NO_COLOR, FORCE_COLOR and CLICOLOR_FORCE, and
tests/e2e.sh unsets FORCE_COLOR and CLICOLOR_FORCE, so a user's own
settings don't change what they check.

Tests: TestColorOn (env x terminal), TestMessagesColored (Say, Info,
Note, Warn, Die colored and plain, the link apart), TestNamesModeStaysPlain,
TestDieLoggedColored, TestColoredStatusLineFits, TestDoneMarkGreen;
msg's TestStringAddsDocLink checks Parts.

Docs: using/settings (Colors, the environment table); contributing
(Messages: Colors).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-31 15:36:13 -07:00
..
2026-10-25 19:00:11 -06:00