Repository navigation
to-human: local file links open in VS Code at their line (7.163.0) - #209
Merged
Merged
Conversation
…open in VS Code at their line on a plain click (7.163.0) On the terminal, [name](/abs/path#L42) in a marked span is drawn as an explicit file: link behind nf-cod-file, and the view answers a plain click on it (onLinkPress, pressableLinks) by opening vscode://file/<path>:<line>. A cmd-click stays Ghostty's, which hands the file: URL to the default app. Links inside code stay literal; remote surfaces draw the text as written.
This was referenced Oct 17, 2026
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
On the terminal, a marked span's link to a local file —
[name](/abs/path#L42)— is drawn as an explicitfile:link behind a file glyph (nf-cod-file, VS Code's own), and a plain click on it opens VS Code at the line (vscode://file/<path>:<line>).Why
The human's global CLAUDE.md now asks every file reference to be written as a Markdown link with the absolute path as its target, so files open from the conversation instead of by hand. The engine's
Markdownelement draws onlyhttp:,https:andfile:links, and a cmd-click is Ghostty's own (it hands afile:URL to the file's default app, so no line). A plain click in the fullscreen terminal is the mod's to answer (onLinkPress+pressableLinks), which is the one place a line can reach VS Code.How
fileLinks(block): rewrites local links outside code regions (reusing the mark parser's code-region reading) tofile://URLs (non-ASCII percent-encoded,#Lkept as fragment) behind the glyph, and returns their targets forpressableLinks.editorUrl(href):file:///p#L42//p#L42→vscode://file/p:42; anything else → undefined.ui.presshook onto-human-links:*runsopen <vscode url>, toasting on failure.Tests
tests/mods/run-mods-tests.sh: 322 pass, 0 fail (3 new: rewrite, URL, a pressed link on the terminal runsopen vscode://…:12, desktop keeps the text as written).claude plugin validate .passes.Not yet verified live: that the real terminal's press carries the
file:target as written (sopressableLinksmatches) and that Ghostty draws the glyph.