Repository navigation
fix(cli): open the browser on WSL when xdg-open is missing - #71
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
|
🎉 This PR is included in version 0.6.2-rc.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This was referenced Nov 13, 2026
Merged
Contributor
|
🎉 This PR is included in version 0.6.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #70.
Summary
On WSL,
deliver --openwrote the file but never opened it. The opener chose its command fromprocess.platformalone, and WSL reportslinux, so it always ranxdg-open. A stock WSL distro doesn't havexdg-open.On WSL, the opener now tries each of these in turn until one works:
darwin open win32 cmd /c start "" "<path>" linux xdg-open +WSL xdg-open → wslview → explorer.exe "$(wslpath -w <path>)"WSL_DISTRO_NAMEorWSL_INTEROPis set, or/proc/versioncontainsmicrosoft.xdg-openis installed but has no Linux browser to open, it fails andexplorer.exestill gets the file.xdg-open not found; wslview not found; explorer.exe not found.Evidence
isWslreading the environment variables. The existing darwin, linux and win32 tests now expect a list of openers. The CLI suites pass, 24 of 24, andbun run typecheckis clean.linux, settingWSL_DISTRO_NAME, and putting stub commands onPATH:explorer.exepresent, exiting with 1: the result is success.explorer.exereceived the absolute path fromwslpath -w.wslviewpresent:wslviewopens the file andexplorer.exeisn't run.xdg-open not found; wslview not found; explorer.exe not found.Merge Danger
Door: two-way
Blast Radius: cli-open-on-linux
Only
--openon Linux changes, and outside WSL it still runsxdg-openalone.