MCPcopy
hub / github.com/codeaashu/claude-code / hasSession

Function hasSession

src/tools/shared/spawnMultiAgent.ts:159–166  ·  view source on GitHub ↗

* Checks if a tmux session exists

(sessionName: string)

Source from the content-addressed store, hash-verified

157 * Checks if a tmux session exists
158 */
159async function hasSession(sessionName: string): Promise<boolean> {
160 const result = await execFileNoThrow(TMUX_COMMAND, [
161 'has-session',
162 '-t',
163 sessionName,
164 ])
165 return result.code === 0
166}
167
168/**
169 * Creates a new tmux session if it doesn't exist

Callers 1

ensureSessionFunction · 0.85

Calls 1

execFileNoThrowFunction · 0.85

Tested by

no test coverage detected