Skip to content

Instantly share code, notes, and snippets.

@mor4thii
Last active December 15, 2021 15:53
Show Gist options
  • Save mor4thii/1256c2f0448d81b0e084f624910efc4b to your computer and use it in GitHub Desktop.
Save mor4thii/1256c2f0448d81b0e084f624910efc4b to your computer and use it in GitHub Desktop.
Behaviour:
`rustup doc` doesn't do anything, `BROWSER=wslview rustup doc` neither.
`rustup doc --std --path` echoes the std doc path, as expected.
`wslview $(rustup doc --std --path)
1. https://github.com/rust-lang/rustup/issues/2206
1. https://github.com/rust-lang/rustup/pull/2792#issue-668990820
1. https://github.com/Seeker14491/opener/issues/4#issuecomment-867285744
Either it will be resolved in the next rustup release, or I need to revisit.
@mor4thii
Copy link
Author

Okay, so after giving this some more thought, this might be connected to the way paths in the linux distro under WSL2 differ from paths that Win10 can see.
Maybe using a more recent version of wslview helps?

@mor4thii
Copy link
Author

wslview $(rustup doc --std --path) now shows rust docs, very good :)

@mor4thii
Copy link
Author

So the resolution to my problem was the following:

$ sudo add-apt-repository ppa:wslutilities/wslu
$ sudo apt update && sudo apt upgrade
$ wslview -r

No need to manually set the BROWSER env var anymore. Nice :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment