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 access file:/// uri from WSL2 #4704

Closed
edyu opened this issue Nov 22, 2019 · 2 comments
Closed

Cannot access file:/// uri from WSL2 #4704

edyu opened this issue Nov 22, 2019 · 2 comments
Labels

Comments

@edyu
Copy link

edyu commented Nov 22, 2019

Please fill out the below information:

  • Your Windows build number: (Type ver at a Windows Command Prompt)
    Microsoft Windows [Version 10.0.19025.1]

  • What you're doing and what's happening: (Copy&paste the full set of specific command-line steps necessary to reproduce the behavior, and their output. Include screen shots if that helps demonstrate the problem.)
    when running commands in the shell that uses Start command.
    for example, I was running fish_config or help in the fish shell. Both of which use the Start command.
    For fish_config it calls
    Start file:///home/ed/.cache/fish/web_config-9S5EM8.html
    and for help it calls Start file:///usr/share/doc/fish/index.html

  • What's wrong / what should be happening instead:
    The Linux path are not recognized in WSL. To make it easier to run commands in WSL2, I'd think all the Linux path should be recognized while in WSL2.
    Here are the commands and the errors:

~ fish_config                                                       
Web config started at 'file:///home/ed/.cache/fish/web_config-9S5EM8.html'. Hit enter to stop.
Start : This command cannot be run due to the error: The system
cannot find the file specified.
At line:1 char:1
+ Start "file:///home/ed/.cache/fish/web_config-9S5EM8.html"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Start-Process]     , InvalidOperationException
    + FullyQualifiedErrorId : InvalidOperationException,Microsoft.P     owerShell.Commands.StartProcessCommand

Shutting down.
 ~ 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.P     owerShell.Commands.StartProcessCommand
@karuboniru
Copy link

karuboniru commented Nov 23, 2019

So...you are calling PowerShell to open /hone/xxx by this?

$ powershell.exe start /home/xxx

That will not work, you need to use

$ powershell.exe start `wslpath -w '/home/xxx'`

or

$ powershell.exe start file://`wslpath -w '/home/xxx'`

Remember that you don't have /home for Windows programs.

You can hack xdg-open to do this convert. Write a "fake xdg-open" that converts linux path to Windows path and call powershell.exe start

@edyu
Copy link
Author

edyu commented Dec 6, 2019

I wasn't. This is mainly for fish shell. I'll inform them of this as well.

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

No branches or pull requests

3 participants