-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Description
What version of Codex CLI is running?
codex-cli 0.105.0
What subscription do you have?
Pro
Which model were you using?
gpt-5.3-codex
What platform is your computer?
Darwin 24.6.0 arm64 arm
What terminal emulator and version are you using (if applicable)?
Wezterm
What issue are you seeing?
Continuation of #1618
When tui.theme = "ansi" is selected, the displayed syntax colors do not follow the terminal’s configured ANSI palette. The current behavior appears to render syntax highlighting with explicit RGB values, which bypasses ANSI index mapping in the terminal.
So in other words: the ansi theme is just another bundled theme that hardcodes random colors instead of using the ANSI-indexed terminal-palette
Relevant code paths suggest this behavior is intentional in current implementation:
codex-rs/tui/src/render/highlight.rs:125: maps ansi to EmbeddedThemeName::Ansi
codex-rs/tui/src/render/highlight.rs:380: applies syntax fg as RtColor::Rgb(fg.r, fg.g, fg.b)
codex-rs/tui/src/render/highlight.rs:371: comments that syntax themes produce RGB colors
What steps can reproduce the bug?
- Configure a terminal with clearly customized ANSI palette colors.
- Set Codex config to:
[tui]
theme = "ansi"
- Open Codex TUI and view syntax-highlighted code content.
- Compare token colors against terminal ANSI palette slots.
What is the expected behavior?
When using the ansi theme, codex should actually use the terminals ansi palette and don't hardcode some random RGB color for syntax highlighting
Additional information
No response