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

Function tmux

freebuff/cli/smoke-test.test.ts:51–67  ·  view source on GitHub ↗
(args: string[])

Source from the content-addressed store, hash-verified

49}
50
51function tmux(args: string[]): Promise<string> {
52 return new Promise((resolve, reject) => {
53 const proc = spawn('tmux', args, { stdio: 'pipe' })
54 let stdout = ''
55 let stderr = ''
56 proc.stdout?.on('data', (d: Buffer) => {
57 stdout += d.toString()
58 })
59 proc.stderr?.on('data', (d: Buffer) => {
60 stderr += d.toString()
61 })
62 proc.on('close', (code) => {
63 if (code === 0) resolve(stdout)
64 else reject(new Error(`tmux failed (exit ${code}): ${stderr}`))
65 })
66 })
67}
68
69const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms))
70

Callers 1

smoke-test.test.tsFile · 0.70

Calls 2

onMethod · 0.65
resolveFunction · 0.50

Tested by

no test coverage detected