[BUG] Clickable file-path links include a trailing period, so cmd-click fails (Ghostty)
Environment
- Claude Code 2.1.300, macOS (Darwin 25.5.0)
- Ghostty 1.3.1, default config
Description
When a file path in Claude's reply ends a sentence (e.g. See docs/vehicles/PLAN.md. or /Users/me/project/report.html.), Claude Code makes the path clickable, but the clickable link includes the trailing .. Cmd-clicking it in Ghostty tries to open PLAN.md., which doesn't exist, so it fails. This happens every time a path ends a sentence.
Ghostty doesn't make bare file paths clickable by itself, so the link (and the trailing .) comes from Claude Code's OSC 8 hyperlink. Ghostty follows the link exactly as Claude Code gives it. As a control, Ghostty's own matcher handles a trailing period on a web URL correctly: echo "see https://example.com." then cmd-click opens https://example.com.
Steps to reproduce
- Run
claudein Ghostty on macOS. - Get the assistant to mention a file path at the end of a sentence, followed by a period.
- Cmd-click the path.
Expected: opens the file, without the period.
Actual: the link target has the trailing . and the open fails.
Suggested fix
Apply the same trailing-punctuation trim to file-path links that the bare-URL linkifier uses for web URLs (strip trailing .,;:!? and unbalanced closing brackets), unless the path with the punctuation actually exists.
Related
- #78267: same kind of problem in the URL linkifier, for full-width punctuation. It describes a trailing-trim pass for ASCII punctuation on URLs; file-path links seem not to get it.
- A closed report of the same problem with a trailing
)from markdown image syntax: "OSC8 hyperlink span incorrectly includes trailing ) from markdown image syntax"