mecatui: click-to-open URLs in scrollback
@jbeda is already working on this.
Since Aug 15, 2026.
- Dominant language
- Go
- Stars
- 152
- Forks
- 16
- Avg merge
- 14h 48m
- Merged PRs (30d)
- 536
Description
Split out of #486 (mouse interactions). The first PR ships clickable approval/plan-review buttons; this is the follow-up for click-to-open links in the conversation scrollback.
Behaviour
A single left-click (press+release, no drag) on a URL in the conversation scrollback opens it in the platform browser. Drag-selection, double-click word-select, and triple-click line-select are unchanged — the open fires only on a clean single click (clickCount==1 + empty selection at release, the existing onMouseRelease empty branch in cmd/mecatui/ui/update.go).
Trust boundary (load-bearing)
Scrollback content is model-influenced and untrusted. The URL must be:
- parsed with
net/url.Parse(never regex-guess the scheme), - gated on a scheme allowlist
{https, http, mailto}(the allowlist lives inui, the consumer), - passed to the opener as ONE direct argv element — NEVER through a shell (
sh -cwould be command injection onfile:///sh:schemes), - length-clamped (e.g. 2048) and control-byte-rejected.
Shape (from the #486 plan)
client/urllaunch.go(new):URLOpenerinterface +NewURLOpener()probingxdg-open/open/rundll32— mirrorsclient/clipboard.go's probe + injected-runner pattern.os/execstays inclient, never inui.ui/urls.go(new):urlAtLine(stripped, col)tokenizer (grapheme-walk likewordAt), scheme allowlist,openURLCmd(async tea.Cmd likeshellWriteCmd), muted status on success/failure.- Deps gains
Opener client.URLOpener(nil disables). - OSC8 hyperlink RENDERING is explicitly out of scope (would break View goldens + interfere with
styleSelectionANSI splicing); click-to-open works by hit-testing text against a URL scan at click time, independent of rendering.
Known v1 limitation: a URL soft-wrapped across two viewport lines is only detected from the clicked line's fragment.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.