MCPcopy
hub / github.com/codeaashu/claude-code / checkTmuxAvailable

Function checkTmuxAvailable

src/utils/tmuxSocket.ts:151–171  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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