MCPcopy Create free account
hub / github.com/Noumena-Network/code / checkTmuxAvailable

Function checkTmuxAvailable

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

Source from the content-addressed store, hash-verified

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

Callers 2

runFunction · 0.85
ensureSocketInitializedFunction · 0.85

Calls 3

getPlatformFunction · 0.85
execFileNoThrowFunction · 0.70
logForDebuggingFunction · 0.70

Tested by

no test coverage detected