[BUG] File-path OSC 8 hyperlinks lack file:// scheme — clicks do nothing in VS Code terminal ("Could not find scheme in link")

Status Open
Reported on v2.1.214
Maintainer reply None cached
Activity 1 comment · opened Jul 18, 2026

Bug Description

In the VS Code integrated terminal, markdown-style links to local files in Claude's output (e.g. [report.md](/Users/me/project/report.md)) are rendered as OSC 8 hyperlinks whose target is the raw absolute path with no URI scheme. VS Code's link opener requires a scheme, so clicking the link silently does nothing.

VS Code renderer log on every click:

[error] Could not find scheme in link "/Users/naval/no-laves-tu-bnb/assets/campana-videos/vA_domingo.mp4":
Error: Could not find scheme in link "/Users/naval/no-laves-tu-bnb/assets/campana-videos/vA_domingo.mp4"
    at c._handleMouseUp (…/@xterm/xterm/lib/xterm.js…)

The CLI builds the escape sequence by interpolating the URL as-is (found in the 2.1.214 binary):

return `\x1B[1m\x1B]8;;${url}\x1B\\${url}\x1B]8;;\x1B\\\x1B[22m`;

Per the OSC 8 spec the target should be a URI. When the markdown link href is a local path, the CLI should emit file://<hostname><path> (like ripgrep's --hyperlink-format does). VS Code would then open the file in an editor tab; iTerm2/Ghostty also expect file:// targets.

Steps to Reproduce

  1. Open Claude Code inside the VS Code integrated terminal (or the VS Code extension's terminal panel).
  2. Ask Claude to output a markdown link whose href is a local absolute path, e.g. [video](/Users/me/clip.mp4).
  3. Click (or Cmd+click) the rendered link → nothing happens; the error above is logged in the renderer log.

Plain http(s) links work (scheme present). Only local-path link targets are affected.

Expected Behavior

Clicking a file link in the terminal opens the file in VS Code (media preview for mp4/png, editor for text), i.e. the OSC 8 target carries a file:// scheme.

Environment Info

  • Platform: darwin (macOS, arm64)
  • Claude Code CLI: 2.1.214 (also VS Code extension 2.1.214)
  • VS Code: 1.129.1
  • Terminal: VS Code integrated terminal (xterm.js)

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗