beads/internal/ui
Johann Dirry 1192508d46
fix(cli): render markdown with terminal capability gates (#3881)
Fixes #3881: `bd show` rendered markdown bodies as unstyled plaintext.

Root cause: the glamour v1->v2 migration dropped the style option from the
`NewTermRenderer` call. In glamour v2 that constructor does not auto-select a
style, so output was emitted with an empty StyleConfig (plaintext) on every
platform. Section labels (DESCRIPTION, COMMENT) stayed colored because they use
`ui.RenderBold`, not glamour -- matching the "headers formatted, body not"
report.

This restores rendering and adds terminal-capability gating:

- ANSI styling when color is supported (honoring NO_COLOR / CLICOLOR / TERM=dumb)
- OSC 8 hyperlinks only on a known-capable terminal allowlist, with a
  FORCE_HYPERLINK override
- glamour notty style as a structured fallback when color is unavailable

Tests (`internal/uimd/markdown_test.go`) cover the styled, plaintext, OSC 8, and
agent-mode paths, including a dedicated #3881 regression guard that fails against
the empty-StyleConfig bug and passes with the fix.

Authored by @MovGP0; regression test and merge by the maintainer.

Agent-Signature: claude-opus-4-8-high on behalf of matt wilkie
2026-06-25 13:55:28 -07:00
..
pager.go feat: add FreeBSD release builds (#832) 2026-01-01 10:51:51 -08:00
pager_test.go style: run gofmt across entire codebase (bd-nmk12) 2026-02-07 19:35:20 -08:00
sanitize.go fix: address PR review feedback 2026-03-30 09:15:55 -07:00
sanitize_test.go Sanitize external tracker content for terminal display and add response size limits 2026-03-30 09:12:26 -07:00
styles.go fix(cli): swap CommandStyle colors for correct light/dark contrast (GH#3611) 2026-05-03 01:46:16 -04:00
styles_test.go feat: custom status categories (active/wip/done/frozen) 2026-03-21 12:35:03 -07:00
terminal.go fix(cli): render markdown with terminal capability gates (#3881) 2026-06-25 13:55:28 -07:00
terminal_test.go fix(cli): render markdown with terminal capability gates (#3881) 2026-06-25 13:55:28 -07:00