[BUG] Clickable file-path links include a trailing period, so cmd-click fails (Ghostty)

Status Open
Reported on v2.1.300
Maintainer reply None cached
Activity 0 comments · opened Oct 14, 2026

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

  1. Run claude in Ghostty on macOS.
  2. Get the assistant to mention a file path at the end of a sentence, followed by a period.
  3. 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"

View original on GitHub ↗