Recognize CUDA .cu and .cuh files for syntax highlighting in CLI diffs

Resolved 💬 1 comment Opened Jul 15, 2026 by brayden-partcl Closed Jul 21, 2026

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:

  1. Edit a .cpp file and a .cu or .cuh file containing comparable C++ code.
  2. View both changes in the Codex CLI TUI.
  3. The .cpp diff 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.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗