Repository navigation
fix(wsl): route global CLI fallbacks to user-pinned terminalWindowsWslDistro - #9734
Merged
nwparker merged 1 commit intoJul 24, 2026
Merged
Conversation
Contributor
📝 WalkthroughWalkthroughAdds OpenSpec documentation and configuration for pinning global GitHub and GitLab CLI fallback execution to the configured WSL distribution. Implements an override in the Git runner, initializes and updates it from 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
nwparker
force-pushed
the
fix/wsl-default-distro-gh-fallback
branch
from
July 23, 2026 11:49
fbdce08 to
2e6009a
Compare
Contributor
|
Thanks so much for this, @TingdeLiu — route global CLI fallbacks to user-pinned terminalWindowsWslDistro. Verified (fail-on-main/pass-on-branch), rebased on latest |
This was referenced Jul 27, 2026
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
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.
fix(wsl): route global CLI fallbacks to user-pinned
terminalWindowsWslDistroSummary
On Windows with WSL-only installs of
gh/glab, global CLI commands now honor the user's pinned WSL distro instead of failing against an arbitrary default distro.ELI5
If your GitHub/GitLab tools live inside one Linux setup on Windows, the app used to guess the wrong one and fail. Now it uses the Linux distro you actually picked in settings.
Root cause & fix
Global CLI calls carry no repository
cwd, so when the host executable is missing the fallback resolved to the first distro fromwsl --listviagetDefaultWslDistro()— wrong when the user's tools/credentials live in a different distro. The fix adds a module-leveldefaultWslDistroOverridewith an exportedsetDefaultWslDistroOverridesetter insrc/main/git/runner.ts;resolveDefaultWslClinow prefersoverride ?? getDefaultWslDistro().src/main/index.tsapplies the override fromterminalWindowsWslDistroboth at startup and on settings change.Evidence
Validated & rebased onto latest main during a bug-bash triage on 2026-07-23. Rebase clean (base
8a23618310, headfbdce08bc2).src/main/git/runner-wsl-gh-fallback.test.ts(new override-vs-default-distro case).origin/main(keeping the test): 22 tests failed — proving the fix is load-bearing:npx oxlint src/main/git/runner.ts src/main/index.ts→ exit 0.Trade-offs
None — pure fix.
Regression risk
Effectively zero. The override defaults to
null, soresolveDefaultWslClifalls back togetDefaultWslDistro()exactly as before when no distro is pinned; only the WSL-fallback branch changes, and non-Windows paths are gated byprocess.platform. Theindex.tswiring is a straightforward read of an existingterminalWindowsWslDistrosetting and cannot be unit-tested directly (ElectronwhenReady), but was inspected.Credit to @TingdeLiu for the original fix. Validated, rebased, and (where applicable) hardened via automated bug-bash review; original fix design preserved.