Skip to content

Render markdown links as OSC-8 hyperlinks in the TUI#17074

Closed
starr-openai wants to merge 1 commit intomainfrom
starr/osc8-rendering-combined
Closed

Render markdown links as OSC-8 hyperlinks in the TUI#17074
starr-openai wants to merge 1 commit intomainfrom
starr/osc8-rendering-combined

Conversation

@starr-openai
Copy link
Copy Markdown
Contributor

Summary

Render remote markdown links as visible labels plus visible destinations while attaching OSC-8 hyperlinks to the rendered label/destination cells and to terminal scrollback replay.

This also centralizes OSC-8 generation/sanitization, teaches terminal width measurement to ignore balanced OSC-8 wrappers, migrates onboarding fixed links to the shared ST-terminated helper, preserves the /mcp docs hyperlink, and records raw VT100 backend writes so history-insertion tests can assert emitted escape bytes.

Coverage

The tests cover:

  • markdown link styling, inline code inside links, nested style, wrapped labels, URL sanitizer control stripping
  • live ratatui Buffer hyperlink marking for remote markdown links, row wraps, blockquotes, and wide glyph skip cells
  • inserted-history OSC-8 replay for ordinary links, wrapped links, heading-adjacent links, and blockquote links
  • onboarding fixed labels and wrapped success-message labels
  • /mcp empty-state docs link remains a clickable OSC-8 label
  • terminal wrapper stripping/width for BEL-terminated legacy and ST-terminated OSC-8

Validation

  • just fmt
  • CARGO_TARGET_DIR=/tmp/codex-osc8-test-target just fix -p codex-tui
  • CARGO_TARGET_DIR=/tmp/codex-osc8-test-target cargo test -p codex-tui --lib passed: 1513 passed, 0 failed, 1 ignored
  • after final rebase to current origin/main: CARGO_TARGET_DIR=/tmp/codex-osc8-test-target cargo test -p codex-tui link -- --nocapture passed: 49/49

Draft while CI and reviewer-facing screenshots/checks run.

Render remote markdown links as visible labels with visible destinations while attaching OSC-8 wrappers to the cells and scrollback bytes that represent the link. Share terminal-wrapper parsing between width measurement, onboarding links, and history insertion, and cover wrapped links, wide glyph cells, blockquotes, /mcp docs, and control-character sanitization.

Co-authored-by: Codex <noreply@openai.com>
@starr-openai starr-openai force-pushed the starr/osc8-rendering-combined branch from dc2a0e1 to 25ef372 Compare April 8, 2026 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant