Option to disable diff background highlight

Resolved 💬 16 comments Opened Feb 25, 2026 by acgxv Closed Feb 28, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What variant of Codex are you using?

cli

What feature would you like to see?

After https://github.com/openai/codex/pull/12581

I can't read. I don't like the background highlight.

<img width="1512" height="258" alt="Image" src="https://github.com/user-attachments/assets/456e4273-2204-4307-a4e7-784183db6c6c" />

@fcoury

Additional information

_No response_

View original on GitHub ↗

16 Comments

etraut-openai contributor · 4 months ago

Which terminal emulator are you using? Which platform?

acgxv · 4 months ago
Which terminal emulator are you using? Which terminal emulator?

Ghostty, I also tested in Zed. All my tokyo-night* terminal themes are not happy with this.

acgxv · 4 months ago

BTW, I use TERM=dumb due to https://github.com/openai/codex/issues/2020. Even if this is fixed I will not use it as I dislike the black input box.

But anyway, I would like to suggest that an option to disable this feature be available.

teneko · 4 months ago

I can confirm that I cannot read anything anymore.

<img width="506" height="97" alt="Image" src="https://github.com/user-attachments/assets/bc8b4e7d-ec62-4d76-985b-278248a90d88" />

The green is too green and the red is too red. Every time I open this terminal, my retinas file a formal complaint. 😅

I use mintty 3.8.1.

Fortunately, mintty can actually change colors (they call it a "theme"). I switched the theme from “mintty” to “html” and finally: the text becomes readable again.

Edit: now ordered lists and code blocks become unreadable 😆 but sadly the "html" theme is the only theme among the others that don't let my eyes bleed.

I think I need to switch back to 0.104.0 for the current time.

ignatremizov · 4 months ago

+1 from my side. My eyes, they burn. The current add/remove diff line backgrounds are too strong for all themes due to being hardcoded in codex-rs/tui/src/diff_render.rs.

Suggested implementation path/spec:

  1. Add a user-facing diff background mode under [tui]:
  • diff_background = "auto" | "off" | "theme" | "custom"
  • default: auto (preserve current behavior)
  1. Behavior by mode:
  • auto: current hardcoded palette (no behavior change)
  • off: no add/remove line background, keep only fg/gutter/sign styling
  • theme: derive add/remove backgrounds from theme scopes if available
  • custom: use explicit user-provided colors
  1. .tmTheme scope mapping for theme mode:
  • additions: markup.inserted, fallback diff.inserted
  • removals: markup.deleted, fallback diff.deleted
  • use scope background if present; fallback to auto for missing scope/background
  1. custom mode config keys (optional, with fallback to auto):
  • diff_add_bg, diff_del_bg
  • accept hex #RRGGBB (and optionally named/indexed later)
  1. Renderer integration:
  • Thread a DiffBackgroundConfig into style_line_bg_for/add_line_bg/del_line_bg
  • keep existing color-level quantization (truecolor/256/16) after resolving target RGB
  1. Nice-to-have follow-up:
  • optional separate control for gutter background (or derive from line bg)
  • include a preview row in /theme so users can verify theme/custom/off quickly.

This would cover both camps: users who want backgrounds disabled and users who want subtle, theme-matched diff backgrounds instead of hardcoded bright red/green.

wenGravitas · 4 months ago

+1 colour blind here and makes it awful to use, please add an option to turn it off.

ignatremizov · 4 months ago

I implemented in https://github.com/ignatremizov/codex/pull/1 but cannot open a PR here

fcoury contributor · 4 months ago

We are working on a fix for this. Meanwhile, can you try running set TERM=xterm-256 first and then running codex and report back.

calh · 4 months ago

I wanted to post that this change bugs me too:

<img width="286" height="61" alt="Image" src="https://github.com/user-attachments/assets/0eaa4dbd-dfa3-468a-b266-7ce6af75b440" />

I chose a theme which is not as terrible as others, but it's still hard to read. I'd prefer the previous 0.104 version with no background.

I'm running KDE Konsole, with terminal settings:

TERM=xterm-256color
COLORTERM=truecolor
COLORFGBG=15;0
TERM_PROGRAM=
LANG=en_US.UTF-8
LC_ALL=
ignatremizov · 4 months ago

@fcoury please look at https://github.com/ignatremizov/codex/pull/1 (it has screenshots)

teneko · 4 months ago
We are working on a fix for this. Meanwhile, can you try running set TERM=xterm-256 first and then running codex and report back.

Nope, nothing changed, at least in mintty, @fcoury.

wenGravitas · 4 months ago
+1 colour blind here and makes it awful to use, please add an option to turn it off.

just to follow up the coloured syntax text in 0.104.0 and earlier was perfect and no problem for me and perhaps other colour challenged folks, it's the coloured backgrounds that cause a prob and make the underlying text unreadable.

ignatremizov · 4 months ago

https://github.com/openai/codex/commit/3b5996f988c35ef282e04df7b7f311a83b562363 is intended to fix this, but there is still no user config override for the background tint from theme files or config.toml [tui] directly

Loongphy · 4 months ago

Ditching the diff theme is a solid move. I'm not sure why we’re trying to bake a full-blown code editor feature in TUI.

acgxv · 4 months ago

Nice. https://github.com/openai/codex/pull/13037

Works good now in latest pre-release.