Allow selecting the Chroma formatter so code blocks can render truecolor
I use a custom style with hex colors, and everything in the document renders 24-bit except fenced code blocks — the syntax colors there are nearest-match approximations of my palette, while headings, links, and inline code are exact. Side by side with inline code on the same line, the mismatch is obvious.
Rendering a fixture under a pty and reading the escapes:
script -q /dev/null glow -w 78 fixture.md | grep -o '3[48];[25];[0-9;]*' | sort -uBody elements come out 38;2;R;G;B; everything inside the fence comes out 38;5;N.
The cause looks like glamour's default rather than anything in the stylesheet: chromaFormatter = "terminal256" in ansi/codeblock.go. glamour does expose WithChromaFormatter (added in charmbracelet/glamour#395) and prefers it over that default, but glow never calls it, so there's no way to reach it from glow.yml or a flag.
Would you take a config key and/or flag that passes the formatter through, so a truecolor terminal can select terminal16m?
glow 2.1.2 (glamour v1.0.0), macOS, terminal advertising COLORTERM=truecolor. I haven't tested that terminal16m produces the output I want — I can only see that the option isn't reachable from glow.
Source: charmbracelet/glow