( session: IsolatedTmuxSession, client: TmuxAttachedClient, )
| 411 | } |
| 412 | |
| 413 | export 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 | |
| 435 | export async function captureAttachedTmuxTrace( |
| 436 | session: IsolatedTmuxSession, |
no test coverage detected