Repository navigation
Open
Labels
enhancementNew feature or requesttuimecatui terminal UI (rendering, keybindings, footer, panes, scrollback)
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.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requesttuimecatui terminal UI (rendering, keybindings, footer, panes, scrollback)
Activity