Code Monkey home page Code Monkey logo

Comments (9)

antoine-coulon avatar antoine-coulon commented on June 26, 2024 1

@hassanmojab, I just released an attempt to a fix for WSL in 0.30.1.

In the best scenario wslview works as expected and the browser will be automatically opened.

In the worst scenario, wslview does not work but now the error is properly managed so the process won't crash and you'll be able to access the application manually. If you have any suggestion to properly use wslview or an alternative as I'm not familiar at all with it, feel free to re-open the issue and keep the discussion going on.

Thanks

from skott.

mojabyte avatar mojabyte commented on June 26, 2024 1

Now it fully works!

from skott.

antoine-coulon avatar antoine-coulon commented on June 26, 2024

Hello @hassanmojab, thanks for the heads up!

It seems that it comes from an upstream problem on WSL microsoft/WSL#8892.
As I'm using a fork of openurl I will do two things:

  1. Try to find a workaround for WSL to be able to keep that auto open behavior (some workarounds are discussed here). The thing is I'm not running WSL myself, so will be hard for me to reproduce and be sure to fix the problem.

  2. Fix the uncaught exception in the library I'm using that should be handled properly and not make the process crash (upstream, not in skott). This would have for consequence to not open the browser automatically but would allow the application to be accessible anyway.

from skott.

mojabyte avatar mojabyte commented on June 26, 2024

The wslview is not installed on wsl by default. I've found this command for opening a URL on the Windows default browser from wsl:

cmd.exe /C start "http://127.0.0.1:40000" > /dev/null 2>&1

from skott.

antoine-coulon avatar antoine-coulon commented on June 26, 2024

Ah fml I was too confident about it 😅 I'll add your cmd.exe in another PR as a primary target when being in WSL. Thanks for the hint! I reopen the issue

from skott.

antoine-coulon avatar antoine-coulon commented on June 26, 2024

Hey again @hassanmojab,

Just released 0.30.2 switching for cmd.exe instead of wslview. Could you please confirm me that it now works well please? I'll wait until then to close the issue.

Thanks!

from skott.

mojabyte avatar mojabyte commented on June 26, 2024

It works! the browser opens with the given URL 127.0.0.1:<port>

But unfortunately, there is still an issue :( 127.0.0.1 is considered as localhost in linux, but not in windows. So the ports of wsl are forwarded to the localhost of the windows and can be accessed by localhost:<port> but not by 127.0.0.1:<port>.

I think you simply can use localhost instead of 127.0.0.1 in the code like other cross-platform applications, and it should solve this problem.

from skott.

antoine-coulon avatar antoine-coulon commented on June 26, 2024

Glad to hear that the auto opening is working as expected on WSL :)

About localhost, I was not aware of that and I thought WSL would manage this transparently. Thanks for the hint! I just changed 127.0.0.1 to localhost on all platforms in 0.30.3.

Could you please test it and confirm me that it now fully works? Thanks again for your reactivity and contribution, highly appreciate it

from skott.

antoine-coulon avatar antoine-coulon commented on June 26, 2024

Thanks again for confirming that @hassanmojab!

from skott.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.