MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / checkTmuxAvailable

Function checkTmuxAvailable

source code/utils/tmuxSocket.ts:153–173  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

151 * - Bash commands will run without tmux isolation
152 */
153export async function checkTmuxAvailable(): Promise<boolean> {
154 if (!tmuxAvailabilityChecked) {
155 const result =
156 getPlatform() === 'windows'
157 ? await execFileNoThrow('wsl', ['-e', TMUX_COMMAND, '-V'], {
158 env: { ...process.env, WSL_UTF8: '1' },
159 useCwd: false,
160 })
161 : await execFileNoThrow('which', [TMUX_COMMAND], {
162 useCwd: false,
163 })
164 tmuxAvailable = result.code === 0
165 if (!tmuxAvailable) {
166 logForDebugging(
167 `[Socket] tmux is not installed. The Tmux tool and Teammate tool will not be available.`,
168 )
169 }
170 tmuxAvailabilityChecked = true
171 }
172 return tmuxAvailable
173}
174
175/**
176 * Returns the cached tmux availability status.

Callers 1

ensureSocketInitializedFunction · 0.85

Calls 3

getPlatformFunction · 0.85
execFileNoThrowFunction · 0.85
logForDebuggingFunction · 0.85

Tested by

no test coverage detected