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

Function tmux

cli/src/__tests__/tmux-poc.ts:21–43  ·  view source on GitHub ↗
(args: string[])

Source from the content-addressed store, hash-verified

19
20// Utility to run tmux commands
21function tmux(args: string[]): Promise<string> {
22 return new Promise((resolve, reject) => {
23 const proc = spawn('tmux', args, { stdio: 'pipe' })
24 let stdout = ''
25 let stderr = ''
26
27 proc.stdout?.on('data', (data) => {
28 stdout += data.toString()
29 })
30
31 proc.stderr?.on('data', (data) => {
32 stderr += data.toString()
33 })
34
35 proc.on('close', (code) => {
36 if (code === 0) {
37 resolve(stdout)
38 } else {
39 reject(new Error(`tmux command failed: ${stderr}`))
40 }
41 })
42 })
43}
44
45// Capture pane content
46async function capturePane(sessionName: string): Promise<string> {

Callers 2

capturePaneFunction · 0.70
testCLIWithTmuxFunction · 0.70

Calls 2

onMethod · 0.65
resolveFunction · 0.50

Tested by

no test coverage detected