Repository navigation
Description
Summary
When conceal is on, named markdown links always paint as:
label (https://example.com/path)
even if the terminal already has OSC 8 hyperlinks. The url field on those chunks is set correctly, so the whole span is clickable — the href is just still visible.
Expected when OSC 8 / hyperlinks capability is on: visible text is only label, with { url: href } on the label chunks.
Expected when OSC 8 is off: keep today’s label (url) so the target is still readable.
Not the same as
- MarkdownRenderable: bare URLs duplicated as 'url (url)' in concealed mode #1050 — bare URLs duplicated as
url (url). That issue treats named[click here](https://…)→click here (https://…)as intended. This issue is the opposite product call for named links when OSC 8 is available. - [Bug] OSC 8 hyperlink labels are not clickable #869 — label vs URL-suffix clickability (Windows Terminal). Here OSC 8 already covers the span; the bug is visible href duplication.
Where
packages/core/src/renderables/Markdown.ts, case "link" in renderInlineToken:
case "link": {
const linkHref = { url: token.href }
if (this._conceal) {
for (const child of token.tokens) {
this.renderInlineTokenWithStyle(child as MarkedToken, chunks, "markup.link.label", linkHref)
}
chunks.push(this.createChunk(" (", "markup.link", linkHref))
chunks.push(this.createChunk(token.href, "markup.link.url", linkHref))
chunks.push(this.createChunk(")", "markup.link", linkHref))
}
// ...
}createChunk already attaches OSC 8 via the link field. Conceal still appends " (" + href + ")" unconditionally.
Contrast: case "image" in the same function already omits the href when conceal is on (label-only + { url }).
Suggested fix
When conceal is on and hyperlinks are enabled (setHyperlinksCapability / OSC 8), emit only the label tokens with { url: token.href }. Skip the " (", href, ")" chunks.
When hyperlinks are off, keep the expanded label (url) fallback.
Optional extra (orthogonal, #1050): if link text === href, never append the suffix.
Why it matters
Consumers (OpenCode TUI) tell agents to write [short-label](long-url) so tables/lists stay narrow. Painting the full URL next to the label undoes that. Agents cannot emit raw OSC 8 (pipeline strips/mangles it); markdown → conceal paint is the only path.
Consumer
anomalyco/opencode#45001 (Warp, OpenCode 1.18.23: OSC 8 works, href still visible).
Activity
simonklee commentedon Aug 25, 2026
Thanks, this is valid, but we have a quite a few of these open now so i'm closing #1380, #1196, #869, and #864. When looking at hyperlinks we'll keep this issue in mind.