()
| 149 | * - Bash commands will run without tmux isolation |
| 150 | */ |
| 151 | export 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. |
no test coverage detected