MCPcopy Create free account
hub / github.com/Noumena-Network/code / detachTmuxClient

Function detachTmuxClient

src/testing/tmuxHarness.ts:413–433  ·  view source on GitHub ↗
(
  session: IsolatedTmuxSession,
  client: TmuxAttachedClient,
)

Source from the content-addressed store, hash-verified

411}
412
413export async function detachTmuxClient(
414 session: IsolatedTmuxSession,
415 client: TmuxAttachedClient,
416): Promise<void> {
417 try {
418 runTmux(session.socketName, ['detach-client', '-s', session.sessionName])
419 } catch {
420 // Best-effort detach; the process may have already exited.
421 }
422
423 if (await waitForProcessExit(client.process, 400)) {
424 return
425 }
426
427 client.process.kill('SIGTERM')
428 if (await waitForProcessExit(client.process, 400)) {
429 return
430 }
431 client.process.kill('SIGKILL')
432 await waitForProcessExit(client.process, 400)
433}
434
435export async function captureAttachedTmuxTrace(
436 session: IsolatedTmuxSession,

Callers 2

captureAttachedTmuxTraceFunction · 0.85

Calls 3

runTmuxFunction · 0.85
waitForProcessExitFunction · 0.85
killMethod · 0.45

Tested by

no test coverage detected