MCPcopy Create free account
hub / github.com/codeaashu/claude-code / getLeaderSessionId

Function getLeaderSessionId

src/utils/swarm/backends/ITermBackend.ts:63–73  ·  view source on GitHub ↗

* Gets the leader's session ID from ITERM_SESSION_ID env var. * Format: "wXtYpZ:UUID" - we extract the UUID part after the colon. * Returns null if not in iTerm2 or env var not set.

()

Source from the content-addressed store, hash-verified

61 * Returns null if not in iTerm2 or env var not set.
62 */
63function getLeaderSessionId(): string | null {
64 const itermSessionId = process.env.ITERM_SESSION_ID
65 if (!itermSessionId) {
66 return null
67 }
68 const colonIndex = itermSessionId.indexOf(':')
69 if (colonIndex === -1) {
70 return null
71 }
72 return itermSessionId.slice(colonIndex + 1)
73}
74
75/**
76 * ITermBackend implements pane management using iTerm2's native split panes

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected