MCPcopy Index your code
hub / github.com/codeaashu/claude-code / formatPathLink

Function formatPathLink

src/commands/terminalSetup/terminalSetup.tsx:65–72  ·  view source on GitHub ↗

* Format a file path as a clickable hyperlink. * * Paths containing spaces (e.g., "Application Support") are not clickable * in most terminals - they get split at the space. OSC 8 hyperlinks solve * this by embedding a file:// URL that the terminal can open on click, * while displaying the clea

(filePath: string)

Source from the content-addressed store, hash-verified

63 * path inherits the parent's styling (e.g., chalk.dim).
64 */
65function formatPathLink(filePath: string): string {
66 if (!supportsHyperlinks()) {
67 return filePath;
68 }
69 const fileUrl = pathToFileURL(filePath).href;
70 // OSC 8 hyperlink: \e]8;;URL\a TEXT \e]8;;\a
71 return `\x1b]8;;${fileUrl}\x07${filePath}\x1b]8;;\x07`;
72}
73export function shouldOfferTerminalSetup(): boolean {
74 // iTerm2, WezTerm, Ghostty, Kitty, and Warp natively support CSI u / Kitty
75 // keyboard protocol, which Claude Code already parses. No setup needed for

Callers 3

installBindingsForZedFunction · 0.70

Calls 1

supportsHyperlinksFunction · 0.85

Tested by

no test coverage detected