Skip to content

Commit e8a3a9f

Browse files
committed
Make isTmuxAvailable work on github actions
1 parent 44a24d5 commit e8a3a9f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

cli/src/__tests__/test-utils.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,20 @@ import fs from 'fs'
33
import path from 'path'
44

55
/**
6-
* Check if tmux is available on the system
6+
* Check if tmux is available and usable on the system.
7+
* This checks both that tmux is installed AND that it can actually run
8+
* (e.g., the tmux server socket directory exists and is accessible).
79
*/
810
export function isTmuxAvailable(): boolean {
911
try {
12+
// First check if tmux is installed
1013
execSync('which tmux', { stdio: 'pipe' })
14+
// Then verify tmux can actually run by creating and killing a test session
15+
// This will fail if tmux server can't start (e.g., no socket directory on CI)
16+
execSync('tmux new-session -d -s __codebuff_tmux_check__ && tmux kill-session -t __codebuff_tmux_check__', {
17+
stdio: 'pipe',
18+
timeout: 5000,
19+
})
1120
return true
1221
} catch {
1322
return false

0 commit comments

Comments
 (0)