Repository navigation
fix(app): terminal links open with ⌘-click, say so on hover, and OSC 8 links open too - #48
Merged
Merged
Conversation
…8 links open too ghostty-web 0.4 underlined a link and showed the pointing hand on a plain hover, where a plain click did nothing (it opens only on ⌘/Ctrl-click), and its OSC 8 links had no address at all (it can't read the URI back from its WASM). Its link providers are replaced: addresses are found per cell, OSC 8 addresses are read from the output on the way in, and both open through openUrl. The hand shows only while ⌘ is held; resting on a link shows "⌘-click to open". xterm.js gets a linkHandler so its OSC 8 links open without confirm() and a blank window.open. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex's ChatGPT sign-in link is a few hundred characters and wraps over several rows of a pane. ghostty-web's links were found one row at a time, so ⌘-click on it found nothing or opened a cut-off address. A row is now read with the rows it runs on over: the ones the terminal soft-wrapped, and, since a box's tmux redraws long lines row by row with the cursor (nothing is marked wrapped), a row full to its last column with address characters there that the next row picks up without a space. The link underlines across all its rows and opens whole from any of them. File paths are found the same way, and an OSC 8 link that wraps is one link. ghostty-web 0.4's isWrapped says a row goes on from the one above (as in xterm.js), not that it wraps onto the next as its docs say. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully 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.
What was broken: "I can't click links in the terminal at all." On the default renderer (ghostty-web 0.4), hovering a URL underlined it and showed the pointing hand, but a plain click did nothing. ghostty-web only opens links on ⌘/Ctrl-click, and nothing said so. OSC 8 hyperlinks (text a program links somewhere) never opened, not even with ⌘-click.
Cause:
cursor: pointer) without any modifier held, butactivateonly runs with ctrl/meta.wasmTerm.getHyperlinkUri(), which in 0.4 is a stub that returnsnull. So those links were underlined on hover but had nothing to open.linkHandler. They fell back toconfirm()plus a blankwindow.open(), and the app's webview supports neither.window.open→openUrl→plugin:shell|opengets the right URL, the shell scope allows http(s), the predict overlay ispointer-events: none, coordinates line up, and tmux's real attach stream (alternate screen, mouse reporting, DECLRMM, sync output) is fine.Fix:
lib/terminal.ts(ghostty): replaces ghostty-web's link providers with our own:lib/term-links.findUrls), so empty cells and wide characters don't shift the columns; the file-path finder now uses the same textwrite(HyperlinkTracker); it handles sequences split across chunks and passes over output with no OSC 8 in it after a quick scanopenUrl, and only http(s)/mailto addresses open.TerminalView).linkHandlerso its OSC 8 links open throughopenUrllike its web links.terminal-links.spec.tsreplays tmux's attach output and checks:term-links.test.ts.Note: tmux on boxes strips OSC 8 unless
terminal-featureshasxterm*:hyperlinks(tmux 3.4+). I left the box's tmux.conf alone because of older tmux on boxes. Plain URLs are what agents print in practice.Checks:
pnpm typecheck:plugins,check:titles,check:csp,check:themes,pnpm test(306 pass),pnpm build,npx tsc -p e2e, docs-site build. E2E:terminal-links(also--repeat-each=5, and once in Playwright WebKit), plus home-terminal, look, idle, drop, keyboard, slow-link, helper-tabs and predict: 43 pass. 1 fails:predict.spec"on a slow link…". It also fails onmainbecause it types "gpu" before the box picker has loaded its list. Not checked in a real Tauri build.🤖 Generated with Claude Code