MCPcopy Create free account
hub / github.com/codeaashu/claude-code / supportsHyperlinks

Function supportsHyperlinks

src/ink/supports-hyperlinks.ts:26–57  ·  view source on GitHub ↗
(
  options?: SupportsHyperlinksOptions,
)

Source from the content-addressed store, hash-verified

24 * @param options Optional overrides for testing (env, stdoutSupported)
25 */
26export function supportsHyperlinks(
27 options?: SupportsHyperlinksOptions,
28): boolean {
29 const stdoutSupported =
30 options?.stdoutSupported ?? supportsHyperlinksLib.stdout
31 if (stdoutSupported) {
32 return true
33 }
34
35 const env = options?.env ?? process.env
36
37 // Check for additional terminals not detected by supports-hyperlinks
38 const termProgram = env['TERM_PROGRAM']
39 if (termProgram && ADDITIONAL_HYPERLINK_TERMINALS.includes(termProgram)) {
40 return true
41 }
42
43 // LC_TERMINAL is set by some terminals (e.g. iTerm2) and preserved inside tmux,
44 // where TERM_PROGRAM is overwritten to 'tmux'.
45 const lcTerminal = env['LC_TERMINAL']
46 if (lcTerminal && ADDITIONAL_HYPERLINK_TERMINALS.includes(lcTerminal)) {
47 return true
48 }
49
50 // Kitty sets TERM=xterm-kitty
51 const term = env['TERM']
52 if (term?.includes('kitty')) {
53 return true
54 }
55
56 return false
57}
58

Callers 8

ClickableImageRefFunction · 0.85
UserImageMessageFunction · 0.85
linkifyIssueReferencesFunction · 0.85
formatPathLinkFunction · 0.85
createHyperlinkFunction · 0.85
renderChromeViewTabLinkFunction · 0.85
LinkFunction · 0.85
formatPathLinkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected