Skip to content

Answer OSC 10/11 color queries so codex shades its logo to the background - #37

Merged
ghosthack merged 2 commits into
mainfrom
answer-osc-10-11-queries
Nov 29, 2026
Merged

ghosthack merged 2 commits into
mainfrom
answer-osc-10-11-queries

Conversation

@ghosthack

Copy link
Copy Markdown
Owner

Codex asks the terminal for its foreground/background colors (OSC 10;? / OSC 11;?) and shades each cell of its braille logo to the background when it gets an answer. macOS Terminal answers; Microhm answered nothing, so codex fell back to SGR 2 dim text, which renders much brighter than the subtle watermark Terminal shows.

Verified by capturing codex 0.172.0's startup output in a pty: no reply produces the ESC[2m dim fallback, while replying makes it emit per-cell dark truecolor (38;2;34;35;36, …).

The emulator now answers OSC 10/11 queries in xterm's rgb:RRRR/GGGG/BBBB form once setOscColors has been given the theme's colors, mirroring the CSI ? 996 n color-scheme pattern: only a client knows its theme, so the daemon never sets them and the queries reach the client (the daemon already forwarded them). TerminalView pushes its default fg/bg on construction, theme change, and palette change.

Tests: OSC answered/unanswered/ignored cases in TerminalEmulatorTest, theme/palette tracking in TerminalViewTest, reply-through-connection in SessionTerminalTest. Full vt suite (533) and app.terminal package (146) pass.

tester and others added 2 commits November 28, 2026 19:42
…ound

Codex asks the terminal for its foreground/background colors and shades
each cell of its braille logo to the background when it gets an answer.
Microhm answered nothing, so codex fell back to SGR 2 dim text, which
renders much brighter than the subtle watermark macOS Terminal shows.

The emulator now answers OSC 10/11 queries in xterm's rgb:RRRR/GGGG/BBBB
form once setOscColors has been given the theme's colors, mirroring the
CSI ? 996 n color-scheme pattern: only a client knows its theme, so the
daemon never sets them and the queries reach the client. TerminalView
pushes its default fg/bg on construction, theme change, and palette
change.
Co-authored-by: ghosthack <ghosthack@users.noreply.github.com>
@ghosthack
ghosthack merged commit 65a90e1 into main Nov 29, 2026
3 checks passed
@ghosthack
ghosthack deleted the answer-osc-10-11-queries branch November 29, 2026 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants