Skip to content

fix(desktop): reveal files via explorer.exe's full path, not a PATH lookup#4137

Merged
esengine merged 1 commit into
main-v2from
fix/reveal-explorer-path
Jun 12, 2026
Merged

fix(desktop): reveal files via explorer.exe's full path, not a PATH lookup#4137
esengine merged 1 commit into
main-v2from
fix/reveal-explorer-path

Conversation

@esengine

Copy link
Copy Markdown
Owner

Crash

Three crash-telemetry reports on Windows v1.6.0, all the same:

[unhandledrejection]
exec: "explorer": executable file not found in %PATH%

Cause

revealPath ("Reveal in file manager") ran exec.Command("explorer", "/select,", path), which does a PATH lookup. explorer.exe lives in %SystemRoot% (C:\Windows), and on installs whose launch environment doesn't carry %SystemRoot% on PATH the lookup fails. The two frontend callers fire the call with a bare void app.RevealPath(...) — no .catch — so the rejected promise became an [unhandledrejection] and got reported as a crash.

Fix

  • Resolve explorer.exe directly from %SystemRoot% (then %windir%), mirroring the SystemRoot/windir resolution already used in sandbox/shell.go. Falls back to the bare name if neither is set.
  • Add .catch(() => {}) at both reveal call sites (ProjectTree, WorkspacePanel) so any future reveal failure (deleted path, etc.) degrades silently instead of crash-reporting.

cd desktop && go build ./... && go vet . clean; gofmt clean. Frontend change is a one-token .catch at each site (no new bindings/types).

…ookup

"Reveal in file manager" ran `exec.Command("explorer", ...)`, relying on
explorer being on PATH. On Windows installs whose launch environment doesn't
include %SystemRoot% on PATH, that fails with `exec: "explorer": executable
file not found in %PATH%`, and because the two frontend callers fire the
promise with a bare `void` (no catch), it surfaced as an [unhandledrejection]
in crash telemetry.

Resolve explorer.exe directly from %SystemRoot% (then %windir%), and catch the
reveal promise at both call sites so a failed reveal can never become an
unhandled rejection again.
@esengine esengine requested a review from SivanCola as a code owner June 12, 2026 06:44
@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development desktop Wails desktop app (desktop/**) labels Jun 12, 2026
@esengine esengine merged commit 0597d06 into main-v2 Jun 12, 2026
14 checks passed
@esengine esengine deleted the fix/reveal-explorer-path branch June 12, 2026 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant