Repository navigation
Conversation
brainkim
marked this pull request as draft
September 22, 2026 22:29
brainkim
force-pushed
the
osc8
branch
3 times, most recently
from
September 25, 2026 01:21
56c3709 to
a2f0c42
Compare
The engine cannot follow a link, but the terminal can. A text cell now carries the id of the link it belongs to, in a table of URLs the framebuffer keeps for its life, so a link that repaints or wraps stays one link to the terminal. The frame writer opens the OSC 8 string when a cell's link differs from the one it has open and closes it before any cursor move, and the diff repaints a cell whose link alone changed. The painter takes the URL from the nearest a[href] or area[href] with an absolute http, https, mailto, file or ftp URL; a fragment, a relative URL or an anchor without href links nothing. The link joins the cell style per text node rather than in the paint style, which is shared by every element resolving to the same values. Closes #106. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015Bw3yEu4cfkuDkaZ3RSy4D
brainkim
marked this pull request as ready for review
November 12, 2026 18:11
# Conflicts: # src/internal/painter.ts
A file: link from a page served from another machine would open a path on the terminal's own. A URL is also held to 2083 characters and to no control bytes, and the table of URLs forgets those no cell links to. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GVbRv5n8btiCtaRBtLrLig
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #106.
An
a[href](orarea[href]) whosehrefresolves to an absolutehttp,httpsormailtoURL now paints its text as a terminal hyperlink:so iTerm2, kitty, WezTerm, Ghostty, foot and Alacritty let the user open it with their own modifier-click or hover, whether or not the page has the mouse. tmux 3.4+ passes the sequence through. Terminal.app has never implemented OSC 8 and ignores the sequence, so a link there looks like any underlined text. The engine still never follows a link itself; a
clicklistener is where an app acts on one.How it's done:
linkplane holding an id into a per-screen URL table, so ids are stable across frames and a link that wraps or repaints stays one link to the terminal.hrefrepaints.hreflinks nothing; a relative URL resolves against the document URL asa.hrefdoes.file:andftp:URLs are not linked: a page served from another machine would otherwise open a path on the terminal's own. A URL over 2083 characters or with a control byte is not linked either, and the URL table forgets URLs no cell links to once it passes 1024.Tests cover the bytes for a link, a link wrapped across lines sharing one id, the three non-links, resolution against the document URL, a href-only change, and the exit print. The input guide describes it.
🤖 Generated with Claude Code
https://claude.ai/code/session_015Bw3yEu4cfkuDkaZ3RSy4D