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

Function tmux

cli/src/__tests__/rerender-perf.integration.test.ts:58–80  ·  view source on GitHub ↗
(args: string[])

Source from the content-addressed store, hash-verified

56
57// Utility to run tmux commands
58function tmux(args: string[]): Promise<string> {
59 return new Promise((resolve, reject) => {
60 const proc = spawn('tmux', args, { stdio: 'pipe' })
61 let stdout = ''
62 let stderr = ''
63
64 proc.stdout?.on('data', (data) => {
65 stdout += data.toString()
66 })
67
68 proc.stderr?.on('data', (data) => {
69 stderr += data.toString()
70 })
71
72 proc.on('close', (code) => {
73 if (code === 0) {
74 resolve(stdout)
75 } else {
76 reject(new Error(`tmux command failed: ${stderr}`))
77 }
78 })
79 })
80}
81
82/**
83 * Send input to the CLI using bracketed paste mode.

Callers 2

sendCliInputFunction · 0.70

Calls 2

onMethod · 0.65
resolveFunction · 0.50

Tested by

no test coverage detected