MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / tmux

Function tmux

cli/src/__tests__/integration-tmux.test.ts:23–45  ·  view source on GitHub ↗
(args: string[])

Source from the content-addressed store, hash-verified

21
22// Utility to run tmux commands
23function tmux(args: string[]): Promise<string> {
24 return new Promise((resolve, reject) => {
25 const proc = spawn('tmux', args, { stdio: 'pipe' })
26 let stdout = ''
27 let stderr = ''
28
29 proc.stdout?.on('data', (data) => {
30 stdout += data.toString()
31 })
32
33 proc.stderr?.on('data', (data) => {
34 stderr += data.toString()
35 })
36
37 proc.on('close', (code) => {
38 if (code === 0) {
39 resolve(stdout)
40 } else {
41 reject(new Error(`tmux command failed: ${stderr}`))
42 }
43 })
44 })
45}
46
47describe.skipIf(!tmuxAvailable || !sdkBuilt)(
48 'CLI Integration Tests with tmux',

Callers 1

Calls 2

onMethod · 0.65
resolveFunction · 0.50

Tested by

no test coverage detected