-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fish_config web url unreachable under WSL #4299
Comments
It might be worth starting with the basics - does it get as far as opening the socket? There's a select-based mainloop - I wonder if there's a problem with the sys.stdin reference there. You could try removing it and seeing if that helps, though then you have to kill the process manually. |
@mqudsi, I think this issue can be closed, everything works fine on my WSL setup. Could have been fixed since the creator's update. I performed the following: Terminal
File ExplorerOpen the following file:
|
@JBanks thanks for trying it out. It's still broken for me on 16299 and 17133 on two different machines, though. What version of fish is this, and do you know if it is executing under python2 or python3? |
@mqudsi
It still opens the port to connect to, but it won't respond to any communication: After running the script, copy the URL, and then close the terminal browser It has to do with this code block from from 2.7.1:
and 2.2.0:
The code removes the TERM environment variable in order to set up the webbrowser library to disallow CLI browsers (most don't allow the use of javascript, so I suspect this is why).
I've tried lynx and w3m from both the current console (as the default browser launched from the python script), and a separate console. From the same console, both fail. From a separate console, they are both successful in connecting (as long as you close the browser as stated above). This is likely from the script not being threaded. I think the python script waits for the browser to close before accepting connections which causes the system to show the open port, while not responding to the clients. @krader1961, it looks like you made this change on 10 November 2016. Can we look at making the OOB import lint friendly, or should we just comment the line so that any future linters know what's going on? If you don't mind, I'd like to make the commit so that this can be my first OSS contribution, I just want to make sure that I follow your code standards. |
@zanchey still not working here. w3m is (still) launched though reading from the filesystem and not after running |
I technically fixed this issue in 99ecaec by launching the URL in the (graphical) system web browser under WSL (in a separate process), but the underlying issue persists. A command line browser must be started in a separate terminal (not possible in a real terminal) or fish_config must be backgrounded (but not suspended). Not sure if I should close this. Do we have another issue tracking #1132? |
I have the same problem. Fish 2.7.1 is there a workaround? |
Try suspending the fish_config process with ctrl-z. |
@zanchey it's funny, your workaround kicked in for me on a different machine today. I think between that and the wsl fix, we're good here for 3.0. |
I am having this problem too but cannot figure out how to fix it based on the comments here. I can find file in |
@imthenachoman what version of fish? |
The latest - 3.0.0. But I was able to get it working. Not sure what fixed it but after a reboot I was able to open the browser. The problem is now that the settings don't save. I change the prompt but it doesn't do anything. Is there anyway to use the web configuration to save the settings in a file I can copy to |
fish_config just runs by executing fish commands. We should have a mode to print the commands it runs (but we don't). |
|
Now, in version 3.0.2 (ubuntu on wsl), I am having this issue too. Maybe some issue with the path used by fish? Below is the output by fish_config:
|
The created HTML file is not accessible outside of WSL anymore after the current version of WSL2, as the filesystem is hidden in a virtual disk image. Instead what I had to do was:
Kind of a pain in the ass, but this doesn't really seem like Fish's fault, just the weirdness of WSL. God only knows what I'm gonna deal with when I install OMF ... 😉 |
I don't have WSL2 so cannot check - what's the final URL that you end up using look like? On WSL1 using fish 3.1b it is file://wsl%24/Ubuntu/usr/local/share/doc/fish/index.html |
the The localhost URL is the usual one, and looks like this or similar: |
Can look into this once WSL2 comes out of the insider program. Might be a while away though... |
Funnily enough, I get a powershell error:
as a workaround for now what worked for me:
|
Should there be another issue for tracking this? I just came here because i have the same problem with wsl2 |
was the fix for me for wsl2 in case anyone came here for the same thing |
Yes, if it's an ongoing issue with WSL2 (which I believe is still in beta?) you could open another issue; you could also ask Microsoft as I imagine there are other programs relying on this behaviour. |
I tried the suggestion from #4299, but for me I'm getting Connection Refused errors. |
@Dunky13 if you're still having this issue, can you open another issue? |
I don't know. I've since switched to Linux, because I was having all sorts of issues with wsl, not just fish. So I can't reproduce it anymore. I do remember that from time to time it would work, other times it wouldn't. Depending on the "mood" my PC booted into |
If the above solutions don't work, your WSL2 distro might not have the latest version of fish-shell/share/tools/web_config/webconfig.py Lines 45 to 52 in ee84223
In particular, "microsoft" instead of "Microsoft"
|
This comment has been minimized.
This comment has been minimized.
Because it was fixed for wsl1. WSL2 (which AFAICT wasn't even released when this bug was closed) is a different bug that is fixed in master (by #7027) and will be released with the next release. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Have a look at #7027 |
When
fish_config
is run under WSL, the URL is inaccessible (hangs indefinitely) both from within WSL and from a web browser running in the Win32 environment.I'm not a pythonista by any means, but I'm willing to debug the issue if anyone has some pointers on where to start. I'm not sure what the correct approach would be to capturing packets here, I'd have to dig into the WSL networking implementation to see how localhost is exposed and how packets can be intercepted (WinPCap doesn't capture localhost, and even if it did, I'm not sure how that plays with WSL).
As a quick test to see if it's a problem with binding to a port from WSL, I ran the following:
But that works fine when accessed from a web browser in Windows.
The text was updated successfully, but these errors were encountered: