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

Cannot call help in WSL #6338

Closed
edyu opened this issue Nov 20, 2019 · 12 comments
Closed

Cannot call help in WSL #6338

edyu opened this issue Nov 20, 2019 · 12 comments

Comments

@edyu
Copy link

@edyu edyu commented Nov 20, 2019

fish, version 2.7.1
Linux strongwin 4.19.79-microsoft-standard #1 SMP Mon Oct 14 00:50:46 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

When I run help in the terminal in WSL (Windows Subsystem for Linux), I get the following error:

 $ help                                         
Start : This command cannot be run due to the error: The system      
cannot find the file specified.
At line:1 char:1
+ Start "file:///usr/share/doc/fish/index.html"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Start-Process],     InvalidOperationException
    + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
@zanchey
Copy link
Member

@zanchey zanchey commented Nov 24, 2019

That looks like a PowerShell error to me, which is not something I'd expect to see under WSL. What does type start show?

@faho
Copy link
Member

@faho faho commented Nov 24, 2019

fish, version 2.7.1

@edyu If possible you'll want to upgrade to 3.0.2, which had changes in help specifically for WSL (99ecaec)

Use our PPA to do so.

@ohk2kt3t4
Copy link

@ohk2kt3t4 ohk2kt3t4 commented Nov 27, 2019

I am getting the same error with fish 3.0.2 on WSL1 using the Ubuntu package. fish finds www-browser which is symlinked to wslview, which is "a fake WSL browser that can help you open link in default Windows browser." The URL being supplied to www-browser in this case is not a Windows path, so the OS cannot open the file. By using the same fix as in #6358 this problem is fixed for me.

Now just have to rethink the logic in help.fish to detect this case and workaround it. Continue discussion in #6358.

@edyu
Copy link
Author

@edyu edyu commented Nov 30, 2019

Same problem on fish 3.0.2

 ~ fish --version                                                                                                      
fish, version 3.0.2                                                                                                    
 ~ help                                                                                                                
Start : This command cannot be run due to the error: The system cannot find the file specified.                        At line:1 char:1                                                                                                       
+ Start "file:///usr/share/doc/fish/index.html"                                                                        
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                            + CategoryInfo          : InvalidOperation: (:) [Start-Process], InvalidOperationException                             + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand            

@faho faho closed this Nov 30, 2019
@zanchey zanchey added this to the fish 3.1.0 milestone Dec 2, 2019
@zanchey
Copy link
Member

@zanchey zanchey commented Dec 2, 2019

Fixed by #6358.

@graphixillusion
Copy link

@graphixillusion graphixillusion commented Apr 11, 2020

I'm still receiving the same error described in the first post. I tried version 3.1.0 under WSL2, Windows 10 2004. Meanwhile, under Windows 10 1909 and MSYS, this is what i got:

MSYS_NT-10.0-18363 VM-PC 3.0.7-338.x86_64 x86_64
 /  fish --version                                     Sat Apr 11 23:41:10 2020
fish, version 3.1.0
 /  help                                               Sat Apr 11 23:41:15 2020
Microsoft Windows [Version 10.0.18363.752]
(c) 2019 Microsoft Corporation. All rights reserved.

C:\msys64>

As you can see, when i type "help" it simply displays the current Windows version and then exit the fish shell.

@krobelus
Copy link
Member

@krobelus krobelus commented Apr 12, 2020

sounds like a different problem; can you show the output of fish_trace=1 help?

@graphixillusion
Copy link

@graphixillusion graphixillusion commented Apr 12, 2020

@krobelus this is the log under MSYS. It's pretty long so i attach a txt file.
log.txt

@krobelus
Copy link
Member

@krobelus krobelus commented Apr 13, 2020

@graphixillusion the last command in that log is

/c/Windows/System32/cmd.exe /c 'start file:///usr/share/doc/fish/index.html'

On a WSL system here this ony works if index.html is accessible to the Windows host, for example if it is on /mnt/c instead of /usr/share. In fact, wslpath fails if it is not accessible, then we fall back to the online version at fishshell.com.
Since you don't have wslpath, is there some other way to convert the path? Or can we detect MSYS somehow and then always fall back to the online version.

@graphixillusion
Copy link

@graphixillusion graphixillusion commented Apr 13, 2020

@krobelus this log is not from the wsl, i have run it under MSYS.

@librarianmage
Copy link

@librarianmage librarianmage commented May 29, 2020

On WSL2, files can be accessed in the windows system under \\wsl$\[distro name], so if wsl is detected, the program could open e.g. file://///wsl$/Ubuntu-20.04/usr/share/doc/fish/index.html

@malobre
Copy link
Contributor

@malobre malobre commented Jun 13, 2020

@krobelus this log is not from the wsl, i have run it under MSYS.

This is another problem, check #7113

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants