* 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)
| 63 | * path inherits the parent's styling (e.g., chalk.dim). |
| 64 | */ |
| 65 | function 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 | } |
| 73 | export 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 |
no test coverage detected