Centralize TUI terminal capability decisions (#63790)

## Why

Terminal-specific checks are spread across rendering and scrollback code.
Independent capability queries let callers share those checks without
starting unrelated terminal probes or caching live settings together.

## What changed

Move scrollback strategy, title encoding, and Markdown link display
decisions into `terminal_capabilities`. Route color detection and resize
reflow limits through the same module. Rendering and scrollback code
apply the selected modes.

GitOrigin-RevId: 6803e4b50ff5d3517efb5c07474d9ce17690e12d
This commit is contained in:
Eric Traut
2026-11-25 01:14:25 +00:00
committed by copyberry
parent 6e32b34f27
commit ebb1ff0e8b
13 changed files with 136 additions and 115 deletions
+1 -1
View File
@@ -213,7 +213,7 @@ fn resolve_diff_backgrounds(
/// mid-render (theme picker live preview).
pub(crate) fn current_diff_render_style_context() -> DiffRenderStyleContext {
let theme = diff_theme();
let color_level = match codex_terminal_detection::terminal_color_level() {
let color_level = match crate::terminal_capabilities::terminal_color_level() {
StdoutColorLevel::TrueColor => DiffColorLevel::TrueColor,
StdoutColorLevel::Ansi256 => DiffColorLevel::Ansi256,
StdoutColorLevel::Ansi16 | StdoutColorLevel::Unknown => DiffColorLevel::Ansi16,