()
| 44 | function findOtherKiloDevSessions(): string[] { |
| 45 | const ownSession = getSessionName(); |
| 46 | try { |
| 47 | const output = execSync('tmux list-sessions -F "#{session_name}"', { |
| 48 | encoding: 'utf-8', |
| 49 | }).trim(); |
| 50 | if (output === '') return []; |
| 51 | return output.split('\n').filter(name => name.startsWith('kilo-dev-') && name !== ownSession); |
| 52 | } catch { |
| 53 | return []; |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | function createSession(sessionName: string, env?: Record<string, string>): void { |
| 58 | const repoRoot = getWorktreeRoot(); |
| 59 | // When another tmux server is already running (e.g. from a sibling worktree), |
| 60 | // `tmux new-session` attaches to that existing server and inherits its |
| 61 | // environment — NOT our current process.env. Pass critical vars with -e and |
no test coverage detected