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

URL opened as file path in WSL2 #20

Closed
btwiuse opened this issue Mar 25, 2023 · 4 comments
Closed

URL opened as file path in WSL2 #20

btwiuse opened this issue Mar 25, 2023 · 4 comments

Comments

@btwiuse
Copy link

btwiuse commented Mar 25, 2023

I use open_browser to open the http://127.0.0.1:33541 in WSL2 with BROWSER="/mnt/c/Program Files/Firefox Nightly/firefox.exe"

The browser opens file://///wsl.localhost/Arch/home/aaron/gear/http/127.0.0.133541 instead of http://127.0.0.1:33541.

Such behavior is caused by wslpath:

$ wslpath -w '127.0.0.1:33541'
http\127.0.0.133541

Can we check if the opened path is a url first before passing it to wslpath?

@Seeker14491
Copy link
Owner

I just fixed this 3 days ago (474f93b). I plan on releasing a new version very soon.

@btwiuse
Copy link
Author

btwiuse commented Mar 26, 2023

But the current solution is relying on the presence of wslview, which is unavailable on non-ubuntu distros. (I use arch btw)

@Seeker14491
Copy link
Owner

It's available for installation on other distros including Arch (which is also my WSL distro), but it's not preinstalled. I did just find out it's no longer preinstalled on Ubuntu as of 22.04. If wslview is missing, there is fallback to xdg-open, though that might not do the "right" thing.

@Seeker14491
Copy link
Owner

Seeker14491 commented Mar 27, 2023

I just released v0.6.0 which includes the fix. I opened #21 for the issue of requiring either wslview or xdg-open to be available on WSL.

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

No branches or pull requests

2 participants