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

cargo doc --open doesn't work on WSL if any of the folders in the path have a space in the name #11920

Open
ChrisChoi314 opened this issue Mar 31, 2023 · 3 comments
Labels
C-bug Category: bug Command-doc O-windows OS: Windows S-needs-info Status: Needs more info, such as a reproduction or more background for a feature request.

Comments

@ChrisChoi314
Copy link

ChrisChoi314 commented Mar 31, 2023

Problem

Running cargo doc --open in a rust project if the path has any spaces causes it to not open the rust docs in the browser. Instead, we get an error that says command 'wslview' did not execute successfully; exit status: 1 and the stderr is, assuming your path of is "your\ path/your_proj/target/doc/your_proj/index.html",

Start-Process : A positional parameter cannot be found that accepts argument 'path\your_proj\target\doc\your_proj\index.html'.
At line:1 char:1
+ Start your path/your_proj/target/doc/your_proj/index.html
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: :)) [Start-Process], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.StartProcessCommand

I expected cargo doc --open to have already replaced all of the spaces with "\ " so that it wouldn't think each space causes the path to be split up into different arguments.

Steps

  1. Use WSL for the following steps.
  2. Create a directory with a space in the name.
  3. Go in that directory from the terminal and make a new Rust project, using cargo add
  4. Go into that directory and run cargo doc --open.

Possible Solution(s)

No response

Notes

No response

Version

cargo 1.65.0
release: 1.65.0
host: x86_64-unknown-linux-gnu
libgit2: 1.5.0 (sys:0.16.0 vendored)
libcurl: 7.58.0 (sys:0.4.59+curl-7.86.0 system ssl:GnuTLS/3.5.18)
os: Ubuntu 18.04 (bionic) [64-bit]
@ChrisChoi314 ChrisChoi314 added the C-bug Category: bug label Mar 31, 2023
@ehuss
Copy link
Contributor

ehuss commented Mar 31, 2023

Which version of wslview do you have? You can view it with: wslview --version.
I can't seem to reproduce it myself, so I suspect that it may be due to using a relatively old distribution (Ubuntu 18). You may want to try updating the version of wslview or try a newer distribution.

@ChrisChoi314
Copy link
Author

ChrisChoi314 commented Apr 1, 2023

It is the version wslu v2.0.0; wslview v05. lsb_release -r seems to show that is ubuntu version 18.04. I will update my ubuntu version to the 22 version now.

@weihanglo
Copy link
Member

@ChrisChoi314. Does it still happen with Ubuntu 22?

@weihanglo weihanglo added the S-needs-info Status: Needs more info, such as a reproduction or more background for a feature request. label Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug Command-doc O-windows OS: Windows S-needs-info Status: Needs more info, such as a reproduction or more background for a feature request.
Projects
None yet
Development

No branches or pull requests

3 participants