Recognize CUDA .cu and .cuh files for syntax highlighting in CLI diffs
What variant of Codex are you using?
Codex CLI (terminal UI)
What feature would you like to see?
Please recognize CUDA source and header extensions (.cu and .cuh) as C++ for syntax highlighting in CLI file diffs.
Currently, equivalent C/C++ files such as .c and .cpp receive token-level syntax highlighting, while .cu and .cuh diffs fall back to plain diff coloring.
Steps to observe:
- Edit a
.cppfile and a.cuor.cuhfile containing comparable C++ code. - View both changes in the Codex CLI TUI.
- The
.cppdiff is syntax-highlighted; the CUDA diff is not.
Expected behavior: CUDA files should receive C++ syntax highlighting as a useful fallback.
Additional information
I searched the issue tracker for existing CUDA/.cu/.cuh syntax-highlighting requests and did not find a matching issue.
The current diff renderer passes the raw path extension into syntax lookup:
https://github.com/openai/codex/blob/main/codex-rs/tui/src/diff_render.rs#L469-L475
The syntax resolver has a small alias map but no CUDA mapping:
https://github.com/openai/codex/blob/main/codex-rs/tui/src/render/highlight.rs#L521-L560
A minimal fallback could extend the existing C++ alias arm:
"cu" | "cuh" | "cppm" | "cxxm" | "ixx" => "cpp",
A custom .tmTheme cannot address this because the file extension fails syntax selection before theme colors are applied.
Observed with codex-cli 0.144.1; the same missing alias is present on current main as of 2026-07-15.