mirror of
https://github.com/openai/codex.git
synced 2026-11-15 21:50:46 +00:00
Preserve prompt contrast when terminal colors are unavailable (#59257)
## Why Submitted prompts need readable foreground and background colors when the terminal does not report its default colors. ## What changed - Use a contrasting gray pair for truecolor and 256-color terminals when default colors are unavailable. Keep terminal defaults for 16-color terminals and unknown color support. - Preserve voice markers, inline element accents, and asynchronous reply code colors when applying prompt styles to native history. ## Testing Add contrast coverage for each color level and terminal rendering regressions for inline elements and asynchronous reply code colors. Update prompt snapshots to cover the fallback colors. GitOrigin-RevId: dcda0fc3e2b12a5dc9046322a4d82c61986e3ecd
This commit is contained in:
+2
-2
@@ -12,8 +12,8 @@ expression: persisted
|
||||
Line::default().bg(Color::Rgb(57, 57, 57)),
|
||||
Line::from_iter([
|
||||
Span::from(" "),
|
||||
Span::from("Answer from "),
|
||||
Span::from("desktop").fg(Color::Rgb(243, 139, 168)).bold(),
|
||||
Span::from("Answer from ").bg(Color::Rgb(57, 57, 57)),
|
||||
Span::from("desktop").fg(Color::Rgb(243, 139, 168)).bg(Color::Rgb(57, 57, 57)).bold(),
|
||||
]).bg(Color::Rgb(57, 57, 57)),
|
||||
Line::default().bg(Color::Rgb(57, 57, 57)),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user