(title: string)
| 159 | } |
| 160 | |
| 161 | function getForkedTitle(title: string): string { |
| 162 | const match = title.match(/^(.+) \(fork #(\d+)\)$/) |
| 163 | if (match) { |
| 164 | const base = match[1] |
| 165 | const num = parseInt(match[2], 10) |
| 166 | return `${base} (fork #${num + 1})` |
| 167 | } |
| 168 | return `${title} (fork #1)` |
| 169 | } |
| 170 | |
| 171 | function sessionPath(worktree: string, cwd: string) { |
| 172 | return path.relative(path.resolve(worktree), cwd).replaceAll("\\", "/") |