openai / openai/codex

[TUI] Rich Markdown mode still renders source heading and list markers

Open
#40,372 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug CLI TUI
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

What issue are you seeing?

With tui.raw_output_mode set to false, Codex correctly selects the rich transcript renderer, but the rendered output still resembles raw Markdown:

  • headings re-insert their source # markers
  • unordered lists render with the source - marker

For example, rich mode currently displays output shaped like:

## Summary
- first item

This makes the rich/raw setting appear ineffective for headings and lists even though the mode switch itself is working.

Expected behavior

Rich mode should communicate Markdown structure through terminal styling and semantic bullets:

Summary
• first item

Raw mode should continue preserving the original Markdown source:

## Summary
- first item

Ordered lists should keep their semantic numbering in rich mode.

Root cause

In codex-rs/tui/src/markdown_render.rs, start_heading explicitly inserts a span containing the repeated # marker. The unordered-list branch similarly inserts - as the displayed marker. These are renderer decisions rather than a configuration or integration issue.

Prepared patch

I prepared and fully tested a patch and would like to contribute it, but this repository currently restricts pull-request creation to collaborators and the contributing guide says external PRs are not accepted. I am opening this issue so the maintainers can evaluate or port the change.

The patch:

  • removes source # markers from rich heading rendering
  • uses • for unordered lists
  • preserves ordered numbering
  • keeps raw mode unchanged
  • updates renderer, streaming, wrapping, and snapshot coverage
Validation
  • RUST_MIN_STACK=16777216 cargo test -p codex-tui -- --test-threads=1
    • 3793 library tests passed, 2 ignored
    • 10 integration tests passed, 4 ignored
    • manager dependency regression test passed
  • cargo fmt --all -- --check
  • git diff --check

The raw/rich snapshot coverage explicitly verifies that raw output retains ## and -, while rich output renders the heading without # and the unordered item with •.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in codex-rs/tui/src/markdown_render.rs, especially the heading and unordered-list rendering paths described in the issue. Run RUST_MIN_STACK=16777216 cargo test -p codex-tui -- --test-threads=1 and review the raw/rich snapshot coverage. Done means rich headings omit source # markers, unordered lists use •, ordered lists retain numbering, and raw mode remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.