You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Many C++ module filetypes don't get syntax highlighting #28223
CLIIssues related to the Codex CLITUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displaybugSomething isn't working
When codex proposes a diff to *.cxx or *.cpp files, the diffs are rendered nicely with syntax highlighting.
When it proposes diffs to *.cxxm or *.ixx files, they don't get syntax highlighting. Removals are red, additions are green. These don't seem to be recognized as C++, even though *.ixx is MSVC's standard for module interface units.
What steps can reproduce the bug?
Ask codex to create or modify a file with the ixx or cxxm extension.
What is the expected behavior?
Diffs to these files to be rendered in the same way as diffs to *.cpp or *.cxx files.
An alternative solution would be to have something like .gitattributes, where you can add *.ixx linguist-language=C++ to specify how extensions are interpreted.
I took a look at this and found the issue is in the TUI syntax lookup path rather than the diff renderer itself.
diff_render::detect_lang_for_path passes the file extension through to highlight_code_to_styled_spans. The syntax lookup in tui/src/render/highlight.rs::find_syntax already patches a few aliases before calling syntect/two-face. ixx and cxxm do not resolve in the bundled syntax set, so the renderer falls back to plain diff coloring.
A minimal fix would be to add:
"cxxm" | "ixx" => "cpp",
to that alias table. I also validated this with:
a syntax lookup regression covering cxxm and ixx
a diff-render regression that creates module.ixx and module.cxxm add diffs and asserts they produce syntax-highlighted RGB spans
Local validation:
just fmt
just test -p codex-tui -> 2867 passed, 4 skipped
just fix -p codex-tui -> passed
Since docs/contributing.md says external code contributions are invitation-only, I’m not opening an unsolicited PR. If this approach matches the intended fix, I’m happy to submit the small patch.
I traced this on current main; the issue appears to be in the extension-to-syntax mapping rather than in the diff renderer itself.
Current flow:
codex-rs/tui/src/diff_render.rs calls detect_lang_for_path(path), which returns the raw file extension string.
That raw extension is passed into highlight_code_to_styled_spans(...).
codex-rs/tui/src/render/highlight.rs::find_syntax has a small patched alias table for names that two-face does not resolve by itself (csharp, c-sharp, golang, python3, shell).
cxxm and ixx are not in that alias table, so they do not resolve to the existing C++ syntax and the diff falls back to plain add/remove coloring.
Extend the existing patched-alias test in render/highlight.rs to include cxxm and ixx.
Add a diff_render.rs test that builds an added-file diff for module.ixx and module.cxxm, then asserts the rendered spans contain syntax-highlighted RGB foreground colors, matching the existing .rs extension coverage.
This keeps the mapping in the current single owner (find_syntax) instead of adding another extension registry in diff_render.rs.
Per docs/contributing.md, I am not opening a PR unless a Codex maintainer explicitly invites one, but I can submit the focused patch + regression tests if wanted.
CLIIssues related to the Codex CLITUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displaybugSomething isn't working
Activity
wgu9 commentedon Jun 15, 2026
I took a look at this and found the issue is in the TUI syntax lookup path rather than the diff renderer itself.
diff_render::detect_lang_for_pathpasses the file extension through tohighlight_code_to_styled_spans. The syntax lookup intui/src/render/highlight.rs::find_syntaxalready patches a few aliases before calling syntect/two-face.ixxandcxxmdo not resolve in the bundled syntax set, so the renderer falls back to plain diff coloring.A minimal fix would be to add:
to that alias table. I also validated this with:
cxxmandixxmodule.ixxandmodule.cxxmadd diffs and asserts they produce syntax-highlighted RGB spansLocal validation:
just fmtjust test -p codex-tui-> 2867 passed, 4 skippedjust fix -p codex-tui-> passedSince
docs/contributing.mdsays external code contributions are invitation-only, I’m not opening an unsolicited PR. If this approach matches the intended fix, I’m happy to submit the small patch.wgu9 commentedon Jun 15, 2026
I traced this on current
main; the issue appears to be in the extension-to-syntax mapping rather than in the diff renderer itself.Current flow:
codex-rs/tui/src/diff_render.rscallsdetect_lang_for_path(path), which returns the raw file extension string.highlight_code_to_styled_spans(...).codex-rs/tui/src/render/highlight.rs::find_syntaxhas a small patched alias table for names thattwo-facedoes not resolve by itself (csharp,c-sharp,golang,python3,shell).cxxmandixxare not in that alias table, so they do not resolve to the existing C++ syntax and the diff falls back to plain add/remove coloring.Minimal fix outline:
Suggested regression coverage:
render/highlight.rsto includecxxmandixx.diff_render.rstest that builds an added-file diff formodule.ixxandmodule.cxxm, then asserts the rendered spans contain syntax-highlighted RGB foreground colors, matching the existing.rsextension coverage.This keeps the mapping in the current single owner (
find_syntax) instead of adding another extension registry indiff_render.rs.Per
docs/contributing.md, I am not opening a PR unless a Codex maintainer explicitly invites one, but I can submit the focused patch + regression tests if wanted.fix(tui): highlight C++ module files (#28554)
fix(tui): highlight C++ module files (openai#28554)
Sync upstream rust-v0.142.0 (#104)
fix(tui): highlight C++ module files (openai#28554)
Sync upstream rust-v0.142.0 to main (#130)