Files
codex/codex-rs/tui
Felipe Coury 553ffa0ad4 fix(tui): promote windows terminal diff ansi16 to truecolor
Windows Terminal supports 24-bit color but `supports-color` often
reports only ANSI-16 because `COLORTERM` is not set. Introduce
`diff_color_level_for_terminal`, a pure mapping from detected color
level to intended diff palette, that promotes to truecolor when
Windows Terminal is detected.

Detection uses two independent signals — `TerminalName::WindowsTerminal`
(from `terminal_info()`) and raw `WT_SESSION` presence — so the
promotion fires even if one detection path changes. When `WT_SESSION`
is present, promotion is unconditional (including `Unknown` level);
without it, only ANSI-16 is promoted for named WindowsTerminal
sessions. Setting `FORCE_COLOR` suppresses both paths to preserve
explicit user intent.

All env reads stay in the thin `diff_color_level()` wrapper; the core
function is pure for testability. Six unit tests cover every branch.
2026-02-26 15:31:28 -03:00
..
2025-09-15 00:42:53 -07:00
2026-02-10 18:50:11 -08:00
2025-08-18 16:02:25 +00:00