Make links clickable on Pax's full screen and show a `watch live` link in the status row
Stacked on https://github.com/pydantic/pydantic-ai/pull/14564.
While computer use is on in a sandbox, Pax's status row now shows watch live ↗, and clicking it opens the desktop viewer in the browser. Before this, the only link was on a computer row in the transcript, and it could not be clicked on the full screen.
Why links did not click
The full screen paints through termflow's ScreenBuffer, which drops OSC 8 hyperlinks. A click opened a URL only if its text was visible in the transcript, so a Rich link on short text such as watch live ↗ did nothing.
What changed
- Clickable painted links, pinned rows only.
paint_rowinui/prompt/prompt_selection.pypaints the rows the shell pins below the transcript (the footer). After it paints a row, it records which cells eachhttp,httpsorfile:OSC 8 link covers, using termflow'svisible_lengthso wide characters line up. On a click,PromptSurface._url_atchecks those cells first, then falls back to the old visible-URL scan of the transcript. Transcript rows record no links, so a model's[label](url)whose target is hidden never opens on one click. StatusLinkfor status segments. A segment may now returnStatusLink(text=, url=), imported fromui/rendering/status.py. The shell adds↗and strips control characters from the text and the URL.LivePrompt._footerwrites it as an OSC 8 link, and closes the link if truncation cuts it. So it works in both modes: on the full screen by a click, and inline with the terminal's own Cmd+click.- The sandbox plugin. It adds a second segment, so the row reads
fake sandbox | watch live ↗. It starts the viewer when computer use turns on, after/sandbox, at session start, and when the conversation changes. The status link and thecomputerrow link point at the viewer's private0600file://redirect page, one per sandbox, made when the viewer starts for it and removed at session end, so the viewer's token never reaches$BROWSERorxdg-openas an argument. The segment itself never starts the server or does IO, because it is read every frame.(computer-use)is left off while the link shows. - Docs.
PLUGINS.md,docs/reference.mdandFILE_MAP.md.
Checks
- Tests:
test_prompt_surface,test_live_prompt,test_status,test_computer_useandtest_sandboxpass. Every changed source line is covered. - tmux check:
/computer-usethen/sandbox e2bon a real E2B sandbox, withBROWSERpointed at a script that logs URLs, so no browser opened.- Inline, the status row was written as an OSC 8 link to the
file://page; no OSC 8 link in the output carriedtoken=. - On the full screen (after a resize), a scripted SGR click on
watch live ↗logged the samefile://page, as did/computer-use view. The page was mode0600, its target answered 200, and it was gone after/exit. The sandbox was deleted.
- Inline, the status row was written as an OSC 8 link to the
Checklist
- No breaking changes in accordance with the version policy.
- Any permitted compatibility impact has a label, warning, migration and release note, and an exact API-check waiver if the gate reports it.
- PR title is fit for the release changelog.
Summary by cubic
Makes hyperlinks clickable on Pax's full screen and adds a watch live ↗ link to the status row while computer use is on. Previously OSC 8 hyperlinks were dropped when painting to the full screen, so clicks only opened URLs whose full text appeared in the transcript, and computer use was linked only from computer rows.
- Records which cells the footer's
http(s)andfile:hyperlinks cover, so a click opens the link under the cursor; a transcript[label](url)link whose target is hidden does not open, and bare visible URLs still open on click. A cut at the row's edge closes an opened link so nothing after the footer gets linked. - Status segments can now return a
StatusLink(text, url), painted as an OSC 8 hyperlink with↗; other painters degrade to simple text. - The sandbox plugin shows
watch live ↗in the status row once the desktop viewer runs, starting the viewer when computer use turns on, at session start, on conversation change, and after/sandbox, without starting it from the frequently-read painter. Links point at one0600file://page per sandbox, so the viewer's token never reaches the browser's command line.