Skip to content

feat(core): add OSC 8 hyperlink metadata to markdown links#607

Merged
kommander merged 1 commit intoanomalyco:mainfrom
cevr:feat/markdown-osc8-links
Feb 2, 2026
Merged

feat(core): add OSC 8 hyperlink metadata to markdown links#607
kommander merged 1 commit intoanomalyco:mainfrom
cevr:feat/markdown-osc8-links

Conversation

@cevr
Copy link
Contributor

@cevr cevr commented Feb 1, 2026

Summary

  • Set link: { url } on TextChunks for markdown link and image tokens, enabling OSC 8 terminal hyperlinks
  • Thread optional link parameter through createChunk and renderInlineTokenWithStyle — backwards-compatible, no new methods
  • All link/image chunk text (label, URL, punctuation) carries the href so the entire rendered span is clickable

The rendering infrastructure (textBufferSetStyledTextlinkAlloc → zig \x1b]8;;URL\x1b\\) was fully wired. The only missing piece was Markdown.ts never populating chunk.link.

Test plan

  • Link chunks carry link.url with conceal=true
  • Link chunks carry link.url with conceal=false
  • Image chunks carry link.url
  • Non-link text has no link metadata
  • Manual: verify Cmd+click opens URLs in iTerm2/Kitty/WezTerm

🤖 Generated with Claude Code

MarkdownRenderable now sets the `link: { url }` property on TextChunks
for link and image tokens, enabling OSC 8 terminal hyperlinks (Cmd+click
in iTerm2/Kitty/WezTerm). The infrastructure was fully wired but
Markdown.ts never populated the link field.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 2, 2026

@opentui/core

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core@607

@opentui/react

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/react@607

@opentui/solid

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/solid@607

@opentui/core-darwin-arm64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-darwin-arm64@607

@opentui/core-darwin-x64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-darwin-x64@607

@opentui/core-linux-arm64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-linux-arm64@607

@opentui/core-linux-x64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-linux-x64@607

@opentui/core-win32-arm64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-win32-arm64@607

@opentui/core-win32-x64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-win32-x64@607

commit: 03c9ec5

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.

2 participants