MCPcopy Create free account
hub / github.com/Noumena-Network/code / formatPathLink

Function formatPathLink

src/commands/terminalSetup/terminalSetup.tsx:66–73  ·  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

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

Callers 3

installBindingsForZedFunction · 0.70

Calls 1

supportsHyperlinksFunction · 0.85

Tested by

no test coverage detected