GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — claude-code-source-code/src/ink/supports-hyperlinks.ts at main · wangwang4git/claude-code-source-code Expand file tree/ Copy pathsupports-hyperlinks.tsMore file actions 57 lines (48 loc) · 1.56 KB / Copy pathsupports-hyperlinks.tsFile metadata and controls57 lines (48 loc) · 1.56 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 import supportsHyperlinksLib from 'supports-hyperlinks' // Additional terminals that support OSC 8 hyperlinks but aren't detected by supports-hyperlinks. // Checked against both TERM_PROGRAM and LC_TERMINAL (the latter is preserved inside tmux). export const ADDITIONAL_HYPERLINK_TERMINALS = [ 'ghostty', 'Hyper', 'kitty', 'alacritty', 'iTerm.app', 'iTerm2', ] type EnvLike = Record<string, string | undefined> type SupportsHyperlinksOptions = { env?: EnvLike stdoutSupported?: boolean } /** * Returns whether stdout supports OSC 8 hyperlinks. * Extends the supports-hyperlinks library with additional terminal detection. * @param options Optional overrides for testing (env, stdoutSupported) */ export function supportsHyperlinks( options?: SupportsHyperlinksOptions, ): boolean { const stdoutSupported = options?.stdoutSupported ?? supportsHyperlinksLib.stdout if (stdoutSupported) { return true } const env = options?.env ?? process.env // Check for additional terminals not detected by supports-hyperlinks const termProgram = env['TERM_PROGRAM'] if (termProgram && ADDITIONAL_HYPERLINK_TERMINALS.includes(termProgram)) { return true } // LC_TERMINAL is set by some terminals (e.g. iTerm2) and preserved inside tmux, // where TERM_PROGRAM is overwritten to 'tmux'. const lcTerminal = env['LC_TERMINAL'] if (lcTerminal && ADDITIONAL_HYPERLINK_TERMINALS.includes(lcTerminal)) { return true } // Kitty sets TERM=xterm-kitty const term = env['TERM'] if (term?.includes('kitty')) { return true } return false } |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |