Skip to content

feat(tui): add OSC 8 web links to rich content#24472

Merged
fcoury-oai merged 8 commits into
mainfrom
fcoury/tui-osc8-web-links
May 27, 2026
Merged

feat(tui): add OSC 8 web links to rich content#24472
fcoury-oai merged 8 commits into
mainfrom
fcoury/tui-osc8-web-links

Conversation

@fcoury-oai
Copy link
Copy Markdown
Contributor

Why

Wrapped URLs in rich TUI output, especially URLs rendered inside Markdown tables, are split across terminal rows. In terminals that support OSC 8 hyperlinks, treating each visible fragment as part of the complete destination enables reliable open-link and copy-link actions even after table layout wraps the URL.

This addresses the semantic-link portion of #12200 and the behavior described in #12200 (comment). It does not change ordinary drag-selection across bordered table rows.

What Changed

  • Added shared TUI OSC 8 support that validates http:// and https:// destinations, sanitizes terminal payloads, and applies metadata separately from visible line width/layout.
  • Added semantic web-link annotations to assistant and proposed-plan Markdown, including explicit web links and bare web URLs in prose and table cells while excluding code and non-web Markdown destinations.
  • Preserved complete URL targets through table wrapping, narrow pipe fallback, streaming, transcript overlay rendering, history insertion, and resize replay.
  • Routed intentional Codex-owned links in notices, status/setup/app-link, feedback, onboarding, MCP/plugin help, memories, and update surfaces through the shared hyperlink handling.

How to Test

  1. Run Codex in a terminal with OSC 8 link support, such as Ghostty, and request an assistant response containing a Markdown table whose last column contains a long https:// URL.
  2. Make the terminal narrow enough for the URL to wrap across multiple bordered table rows.
  3. Use the terminal's open-link or copy-link action on more than one wrapped URL fragment and confirm each fragment resolves to the complete original URL.
  4. Resize the terminal after the table is rendered and repeat the link action to confirm the destination survives scrollback replay.
  5. Open the transcript overlay while rich output is present and confirm web links remain interactive there.
  6. As a regression check, render inline/fenced code containing URL text and a Markdown link such as [https://example.com](mailto:support@example.com); confirm these do not acquire a web OSC 8 destination.

Targeted automated coverage exercised Markdown links and exclusions, wrapped and pipe-fallback tables, streaming/transcript overlay propagation, status-link truncation, and rendered word-wrapping cell alignment. just test -p codex-tui was also run; it passed the hyperlink coverage and reproduced two unrelated existing guardian feature-flag test failures.

@fcoury-oai fcoury-oai force-pushed the fcoury/tui-osc8-web-links branch 2 times, most recently from 7809c0f to 094b673 Compare May 27, 2026 18:49
Copy link
Copy Markdown
Collaborator

@etraut-openai etraut-openai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, and I validated the fix manually

There are merge conflicts the resolve before merging

@fcoury-oai fcoury-oai enabled auto-merge (squash) May 27, 2026 19:30
@fcoury-oai fcoury-oai force-pushed the fcoury/tui-osc8-web-links branch from 094b673 to ab616e4 Compare May 27, 2026 19:47
@fcoury-oai fcoury-oai merged commit 7a26497 into main May 27, 2026
45 of 47 checks passed
@fcoury-oai fcoury-oai deleted the fcoury/tui-osc8-web-links branch May 27, 2026 20:14
@github-actions github-actions Bot locked and limited conversation to collaborators May 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants