-
Notifications
You must be signed in to change notification settings - Fork 46
Attempt to use explorer.exe on http|https
#14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Very interesting investigation, thanks! Can't say I know too much about Would it make sense to add |
🤔 Based on my reading of the source code, I can think of 2 reasons to fall back to
If those reasons make sense to you, I'll add |
|
I think based on your investigation and usage of WSL you're in a much better position to make a determination here. I guess I'm just concerned that with such little experience in WSL, I want to derisk this. However, I think it would be fine to accept the PR as-is and use it as an opportunity to discover unknowns. The cost of breaking people here is not incredibly high, as there are a variety of workarounds (e.g. What do you think? Learning opportunity? |
|
🤔 Coming back to this with a fresh mind, I think there's no harm in falling back to I feel like most unknowns can also be discovered by keeping |
|
Oh, I didn't even realize until just now taking a closer look at the source code, but this project also supports the So now I'm actually leaning heavily towards leaving everything as it is and closing this PR. What do you think? Still not a fan of |
|
Hmm, I wonder if that's support that just came in with the fork from However, it's likely there are some other modules depending on this one, even if we don't officially support it. Maybe we could look at the |
Works for me! Since this is a bit more complex than a 1-line change and I'd like to add a test for this, I'll do this later when I get to my main device. |
explorer.exe directly instead of wslviewexplorer.exe on http|https
This will attempt to use `explorer.exe` (available in WSL) when the protocol is either HTTP or HTTPS. Either way, `wslview` is a fallback.
|
Thanks. I created cli/cli#10466 to track getting this into |
|
Drafting until I address cli/cli#10466 (comment) and have a chance to do a reality check on a device with WSL |
|
Closing on account of discussion in cli/cli#10466 |
Part of my motivation of this PR is to start a conversation on this.
After noticing that
wslviewfelt really slow, I looked into the source code to see what the cause was. I noticed thatwslviewwas doing a lot of stuff which, IMO, is unnecessary for the purposes ofgh.What
wslviewdoes is:reg.exeto check if the build number is high enough (not used when opening URLs)curling it and asserting that content was returned (a potential source of slowness, this can be skipped with--skip-validation-checkon newer versions ofwslview).And, after these validations, what it boils down to is calling either
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command "explorer.exe $URL"or/mnt/c/Windows/System32/cmd.exe /c explorer.exe "$URL". Starting a PowerShell process seems to contribute a lot to the slowness.There's a bit of extra work in case a different prefix is used than
/mntor Windows is installed to a different drive thanC:, but this should sum up the vast majority of cases.I think these validations aren't necessary as long as
LookPathis used, andexplorer.execan be called directly. I've noticed a pretty decent gain in speed when usingGH_BROWSER=explorer.exeoverGH_BROWSER=wslview.