* 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.
()
| 61 | * Returns null if not in iTerm2 or env var not set. |
| 62 | */ |
| 63 | function 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 |
no outgoing calls
no test coverage detected