Skip to content

[Bug] OSC 8 hyperlink labels are not clickable #869

Closed as duplicate
Closed as duplicate

Description

@countzero

Description

When markdown concealment is enabled, a markdown link like:

[opentui#866](https://github.com/anomalyco/opentui/pull/866)

renders visually as:

opentui#866 (https://github.com/anomalyco/opentui/pull/866)

But in Windows Terminal with PowerShell, only the visible URL suffix is clickable. The visible label text opentui#866 is not clickable.

Expected behavior

With concealment enabled, the visible label text should carry the same OSC 8 hyperlink metadata as the link target, so the user can Ctrl+Click the label itself. The clickable region should include the rendered link label, not only the visible URL suffix.

Actual behavior

Only the rendered URL portion is clickable:

  • Not clickable: opentui#866
  • Clickable: (https://github.com/anomalyco/opentui/pull/866)

Environment

  • OpenCode: 1.3.0
  • @opentui/core: 0.1.90
  • OS: Windows 11
  • Terminal: Windows Terminal
  • Shell: PowerShell 7.6.0

Reproduction

Render a markdown link in a concealed markdown block, for example:

[opentui#866](https://github.com/anomalyco/opentui/pull/866)

Observe that:

  • the label is shown
  • the URL suffix is shown
  • Ctrl+Click works on the URL suffix
  • Ctrl+Click does not work on the label

Analysis

This appears to be specific to the concealed markdown rendering path:

  • opentui#607 added link: { url } metadata in the markdown token/chunk path
  • normal markdown paragraphs are now rendered through CodeRenderable(filetype="markdown")
  • with conceal=true, the visible label is produced by the tree-sitter conceal/render path
  • the visible URL suffix is linkified separately
  • result: the URL cells get OSC 8 metadata, but the concealed label cells do not

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions