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