From 92cbd6aaf3a127a4927e126958705790affe1509 Mon Sep 17 00:00:00 2001 From: Brian Leishman Date: Wed, 8 Jul 2026 16:37:06 -0400 Subject: [PATCH] =?UTF-8?q?fix(windows):=20don't=20launch=20Explorer=20wit?= =?UTF-8?q?h=20SW=5FHIDE=20=E2=80=94=20folder=20windows=20opened=20invisib?= =?UTF-8?q?le?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit runExplorer set HideWindow on the SysProcAttr, which puts SW_HIDE into Explorer's STARTUPINFO. Explorer honors the hint for the folder window it opens, so every /open request succeeded but the window never appeared. The flag guarded against a console flash that can't happen: release builds use -H windowsgui. Co-Authored-By: Claude Fable 5 --- open_windows.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/open_windows.go b/open_windows.go index bd72706..fece901 100644 --- a/open_windows.go +++ b/open_windows.go @@ -20,9 +20,12 @@ func revealFile(path string) error { // runExplorer fires Explorer and deliberately ignores its exit code: // explorer.exe famously exits 1 even on success. openPath has already // verified the target exists, which is the error case we care about. +// +// Do NOT set HideWindow here: Explorer honors the STARTF_USESHOWWINDOW / +// SW_HIDE hint and opens the folder window invisible. func runExplorer(cmdLine string) error { cmd := exec.Command("explorer.exe") - cmd.SysProcAttr = &syscall.SysProcAttr{CmdLine: cmdLine, HideWindow: true} + cmd.SysProcAttr = &syscall.SysProcAttr{CmdLine: cmdLine} if err := cmd.Start(); err != nil { return fmt.Errorf("start explorer: %w", err) }