Open
Description
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
- Use WSL for the following steps.
- Create a directory with a space in the name.
- Go in that directory from the terminal and make a new Rust project, using
cargo add
- 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]