Skip to content

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

Description

@youngjunning

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 •.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLITUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displaybugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions