From 8d396294a98e0dae68a9b9aa47954e2a779c604d Mon Sep 17 00:00:00 2001 From: M T Date: Tue, 23 Jun 2026 11:57:39 +1000 Subject: [PATCH] fix: WSL auto-open crash + Windows-interop handoff MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit spawn()'s ENOENT for a missing binary surfaces via the async 'error' event, not a synchronous throw — the prior try/catch never caught it, crashing the whole process when xdg-open isn't installed (the normal case on WSL, which has no desktop environment). WSL also now hands off to explorer.exe via WSL interop (wslpath -w to get a Windows-style path) instead of trying xdg-open at all. Verified against a real WSL2 box: the prior code crashed on `-- open`, this one opens the file in the user's actual Windows browser. Co-Authored-By: Claude Sonnet 4.6 --- bin/gstack-sprint-dashboard | 42 ++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/bin/gstack-sprint-dashboard b/bin/gstack-sprint-dashboard index c75a75969..460ee6c25 100755 --- a/bin/gstack-sprint-dashboard +++ b/bin/gstack-sprint-dashboard @@ -18,7 +18,7 @@ */ import { existsSync, readFileSync, writeFileSync, statSync, readdirSync } from "fs"; -import { join, basename } from "path"; +import { join, basename, resolve } from "path"; import { execFileSync, spawn } from "child_process"; import { homedir } from "os"; @@ -773,26 +773,58 @@ function renderPage(slug: string, branch: string, sections: Record { + console.error(`Could not auto-open ${absPath} automatically — open it manually.`); + }); child.unref(); } catch { - console.error(`Could not auto-open ${path} — open it manually.`); + console.error(`Could not auto-open ${absPath} automatically — open it manually.`); } }