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 opens VSCode instead of a browser #7447

Closed
rask opened this issue Sep 26, 2019 · 3 comments
Closed

cargo doc --open opens VSCode instead of a browser #7447

rask opened this issue Sep 26, 2019 · 3 comments
Labels
C-bug Category: bug

Comments

@rask
Copy link

rask commented Sep 26, 2019

Problem

When I invoke

cargo doc --open

on Ubuntu 18.04 with Chromium and Firefox available, the command decides to open VSCode instead of either of those browsers. Even when Chromium is running, VSCode is opened.

Steps

  1. Install Ubuntu
  2. Install chromium-browser and firefox
  3. Install Rust tooling via rustup
  4. Install VSCode
  5. Create library crate locally
  6. Run cargo doc --open

Not sure what else might be required to get a 100% reproduction.

Possible Solution(s)

I presume this stems from VSCode being an Electron app (right?) and Cargo somehow detects this as a browser or something?

Notes

Output of cargo version: cargo 1.38.0 (23ef9a4ef 2019-08-20)

@rask rask added the C-bug Category: bug label Sep 26, 2019
@sfackler
Copy link
Member

Cargo just calls xdg-open <path_to_index.html> via https://docs.rs/opener/0.4.0/opener/.

@rask
Copy link
Author

rask commented Sep 26, 2019

I see, will try and see if my system is messed up in this regard.

EDIT:

Aight it seems like I found the issue:

[2001]  23:13:08 ojrask@ojrask-ubuntu:~/.local/share/applications
$ cat mimeapps.list

[Default Applications]
text/html=code-url-handler.desktop
x-scheme-handler/http=chromium-browser.desktop
x-scheme-handler/https=chromium-browser.desktop
x-scheme-handler/about=chromium-browser.desktop
x-scheme-handler/unknown=chromium-browser.desktop
x-scheme-handler/vscode=code-url-handler.desktop

Will fix this, sorry for noise!

@rask rask closed this as completed Sep 26, 2019
@rask
Copy link
Author

rask commented Sep 26, 2019

For reference, this issue was fixed with

$ xdg-mime default chromium-browser.desktop text/html

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

No branches or pull requests

2 participants