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

Function isInITerm2

src/utils/swarm/backends/detection.ts:90–104  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

88 * so no external CLI tool installation is required.
89 */
90export function isInITerm2(): boolean {
91 if (isInITerm2Cached !== null) {
92 return isInITerm2Cached
93 }
94
95 // Check multiple indicators for iTerm2
96 const termProgram = process.env.TERM_PROGRAM
97 const hasItermSessionId = !!process.env.ITERM_SESSION_ID
98 const terminalIsITerm = env.terminal === 'iTerm.app'
99
100 isInITerm2Cached =
101 termProgram === 'iTerm.app' || hasItermSessionId || terminalIsITerm
102
103 return isInITerm2Cached
104}
105
106/**
107 * The it2 CLI command name.

Callers 5

execIntoTmuxWorktreeFunction · 0.85
isAvailableMethod · 0.85
isRunningInsideMethod · 0.85
detectAndGetBackendFunction · 0.85
isInProcessEnabledFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected