Make /diff an interactive TUI explorer

Resolved 💬 5 comments Opened Apr 16, 2026 by Lloyd-Pottiger Closed May 31, 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?

/diff in the TUI currently renders a static git diff-style pager. That works for very small patches, but it becomes hard to review real multi-file changes because there is no file list, no fast file-to-file switching, and no dedicated preview pane.

I would like /diff to open an interactive TUI diff explorer instead of a raw pager.

A good baseline experience would be:

  • a left pane with the changed file list
  • per-file +/- counts in that list
  • a right pane showing the selected file's diff preview
  • keyboard navigation between the file list and the preview pane
  • support for modified, renamed, and untracked files
  • responsive scrolling for large diffs

This would keep review inside Codex CLI instead of forcing users to switch to VS Code, GitLens, or another terminal UI just to inspect changes comfortably.

Additional information

This request is specifically about the CLI/TUI /diff command, not the App or IDE extension diff UIs.

I also built a working prototype locally on a fork. Since external PRs are not currently accepted, I am opening this as an issue instead.

Prototype branch and compare link:

The prototype does the following:

  • parses git diff output into structured per-file changes
  • opens /diff in a two-pane explorer with file switching and preview scrolling
  • includes rename and untracked-file handling
  • caches preview rendering to avoid lag on large diffs
  • keeps the new UI isolated in a dedicated diff_explorer module

Validation run locally:

  • cargo fmt -p codex-tui
  • CODEX_SKIP_VENDORED_BWRAP=1 cargo test -p codex-tui diff_explorer_overlay -- --nocapture
  • CODEX_SKIP_VENDORED_BWRAP=1 cargo test -p codex-tui parse_tracked_git_diff_splits_modified_and_renamed_files -- --nocapture

View original on GitHub ↗

5 Comments

Lloyd-Pottiger · 4 months ago

<img width="3024" height="1964" alt="Image" src="https://github.com/user-attachments/assets/d76a8749-68a7-4fac-8ded-b9c1925d025f" />

cm-collins · 4 months ago

I would like to work on this. @etraut-openai

A smaller first version could focus on improving the existing /diff flow without trying to build the full Cursor-like experience immediately.

Proposed v1 scope:

  • Keep /diff as the entry point
  • Show a list of changed files before rendering the diff
  • Allow selecting a specific file to view its diff
  • Support /diff <file> for directly opening a clean per-file diff
  • Preserve the existing git-style diff output, but make it easier to navigate when multiple files changed

This would make the feature useful quickly while keeping the PR small and easier to review.

If maintainers agree with this scope, I can start by exploring the current TUI diff implementation and submit a focused PR.

etraut-openai contributor · 4 months ago

@cm-collins, we generally prioritize Codex features based on community feedback (upvotes). This feature request hasn't received any upvotes yet. We don't generally accept external code contributions.

cm-collins · 4 months ago
@cm-collins, we generally prioritize Codex features based on community feedback (upvotes). This feature request hasn't received any upvotes yet. We don't generally accept external code contributions.

sure , I understand @etraut-openai

etraut-openai contributor · 2 months ago

This feature request hasn't received enough upvotes, so I'm closing.