When I open a terminal within vs code I see this :
roelof@DESKTOP-6H677GO:~/exercism/rust/hello-world$ cargo
Command 'cargo' not found, but can be installed with:
sudo apt install cargo
but when I open the ubuntu terminal on Windows 10 I see this :
roelof@DESKTOP-6H677GO:~/exercism/rust/hello-world$ cargo
Rust's package manager
USAGE:
cargo [OPTIONS] [SUBCOMMAND]
OPTIONS:
-V, --version Print version info and exit
--list List installed commands
--explain <CODE> Run `rustc --explain CODE`
-v, --verbose Use verbose output (-vv very verbose/build.rs output)
-q, --quiet No output printed to stdout
--color <WHEN> Coloring: auto, always, never
--frozen Require Cargo.lock and cache are up to date
--locked Require Cargo.lock is up to date
--offline Run without accessing the network
-Z <FLAG>... Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
-h, --help Prints help information
Some common cargo commands are (see all commands with --list):
build Compile the current package
check Analyze the current package and report errors, but don't build object files
clean Remove the target directory
doc Build this package's and its dependencies' documentation
new Create a new cargo package
init Create a new cargo package in an existing directory
run Run a binary or example of the local package
test Run the tests
bench Run the benchmarks
update Update dependencies listed in Cargo.lock
search Search registry for crates
publish Package and upload this package to the registry
install Install a Rust binary. Default location is $HOME/.cargo/bin
uninstall Uninstall a Rust binary
See 'cargo help <command>' for more information on a specific command.
roelof@DESKTOP-6H677GO:~/exercism/rust/hello-world$
Also try running which cargo from the WSL terminal to find the directory containing cargo, then run echo $PATH on the VS Code terminal and make sure that the directory is in that list.
I don't think that's what the extension is for. I think that's used to work inside WSL, browse the WSL's directories etc. If you want to simply use WSL to build something in say 'D:/Dev/SomeRustProject' you should be able to simply set the ubuntu terminal as the default terminal for vscode and that should be sufficient.
That works too. But the nice thing about the extension is if the intent is to use WSL for a project, you can open a project in vs code in the extension and then everything gets routed through vs code including the terminal, the debugger and any extensions, without any additional setup. And you can certainly open a project through WSL at /mnt/d/Dev/SomeRustProject.
Yeah you can do that definitely. Just pointing out that it's not particularly the solution/cause to OP's problem rather a totally different way to go about it. And yeah that is IMO the more elegant solution, If I used windows I'd probably just use WSL completely using the WSL extension.
My workplace is running .NET stuff with Visual Studio, MSSQL, Xamarin.... the whole shebang. If I wasn't working from home I'd die a little every day thankfully I have my own laptop on hand since I am at home.
You can pretty much use Windows as a Linux machine as long as you don't have to touch a gui. It really is a breath of fresh air. My windows environment (in my home desktop, not the work laptop or my personal manjaro laptop) has pretty much nothing that makes it seem like it belongs to a developer. Everything there like RUST and everything else is set up under WSL.