| 163 | } |
| 164 | |
| 165 | function openBrowser(url: string): void { |
| 166 | try { |
| 167 | if (process.platform === "darwin") { |
| 168 | const child = spawnSync("open", [url], { stdio: "ignore" }); |
| 169 | if (child.status === 0) return; |
| 170 | } else if (process.platform === "linux") { |
| 171 | const child = spawnSync("xdg-open", [url], { stdio: "ignore" }); |
| 172 | if (child.status === 0) return; |
| 173 | } else if (process.platform === "win32") { |
| 174 | const child = spawnSync("cmd", ["/c", "start", "", url], { stdio: "ignore" }); |
| 175 | if (child.status === 0) return; |
| 176 | } |
| 177 | } catch { |
| 178 | // Best-effort only. |
| 179 | } |
| 180 | } |
| 181 | |
| 182 | async function runIssueFlow(): Promise<number> { |
| 183 | intro("Magic Context Issue Report"); |