Skip to content
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

export BROWSER='/mnt/c/path/to/ms_edge_binary' #3405

Closed
snobu opened this issue Jul 25, 2018 · 11 comments
Closed

export BROWSER='/mnt/c/path/to/ms_edge_binary' #3405

snobu opened this issue Jul 25, 2018 · 11 comments

Comments

@snobu
Copy link

snobu commented Jul 25, 2018

All WSL distros should export BROWSER='/mnt/c/path/to/ms_edge_binary' by default, so something like

$ python -m webbrowser -t "http://www.python.org"

can pop up a browser.

Also, this part (/mnt/c/path/to/ms_edge_binary) isn't trivial, you can't just launch the .exe since there's no .exe, there are just some shims, instead you need to do horrible things like

export BROWSER='/mnt/c/Windows/System32/cmd.exe /c start shell:AppsFolder\Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge'

which doesn't really work.

If you export BROWSER='/mnt/c/path/to/chrome.exe' it all works nicely, so that's what WSL should strive for with Edge.

I believe an extra shim, e.g. WSLEdgeShim.exe would be a good enough solution, as long as it's exported by default.

@snobu snobu changed the title export BROWSER='path_to_ms_edge_binary' export BROWSER='/mnt/c/path/to/ms_edge_binary' Jul 25, 2018
@benhillis
Copy link
Member

@snobu - You can make it a bit less horrible:
cmd.exe /c start microsoft-edge:

@snobu
Copy link
Author

snobu commented Jul 25, 2018

That doesn't work. Actually my horrible example doesn't work either, i just tried to mock up a launch command.

Microsoft Windows [Version 10.0.17134.165]

@benhillis
Copy link
Member

@snobu - Works on my box:
ben@BENHILL-STUDIO:/mnt/c/Users/benhill$ cmd.exe /c start microsoft-edge:

@snobu
Copy link
Author

snobu commented Jul 25, 2018

Yes, that works, but doesn't work when exported as BROWSER env var to be consumed by Python/Node/etc. Both Chrome and Internet Explorer work well in this scenario.
image
image
jaws

@therealkenc
Copy link
Collaborator

Ran course. If the ask here is "Chrome & IE good, Edge bad" there is the Feedback Hub and an Edge Microsoft Edge platform feedback site.

@PAGuardado
Copy link

Hey! this is closed but i can't find the solution yet!
is there any at all?
I want WSL to call for 'edge' whenever it needs a internet browser

@Biswa96
Copy link

Biswa96 commented Aug 8, 2019

You could try the new Edge+Chromium thing.

@PAGuardado
Copy link

I guess it could work, but I can't find how to even try it!
can you explain us how please?

@snobu
Copy link
Author

snobu commented Aug 8, 2019

Is running Windows binaries still a thing in WSL2?

@Biswa96
Copy link

Biswa96 commented Aug 8, 2019

Windows binary (PE) can be executed in WSL2 as same as in WSL1, like before. Just enter the executable name. For example, my Firefox is here D:\Firefox\firefox.exe then enter /mnt/d/Firefox/firefox.exe.

@therealkenc
Copy link
Collaborator

therealkenc commented Aug 8, 2019

I want WSL to call for 'edge' whenever it needs a internet browser

That "whenever" is the rub. It isn't straightforward to coax xdg-open(1) into calling a windows browser using WSL interop, but it is possible. Long story short Ben's answer from July 2018. Ref #3832 et al. You'll need to set the $BROWSER environment variable in your .bashrc yourself.

You could try the new Edge+Chromium thing.

The original motivation for the ask in the OP was "you can't just launch the .exe since there's no .exe". Haven't looked but I doubt that changed with NewEdge. It's Chromium under the hood, but that is unrelated to the launch mechanism.

For example, my Firefox is here D:\Firefox\firefox.exe

Needless to say, firefox.exe isn't a problem because existence .exe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants