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

Vscode does not open links in default browser #233399

Open
arijoon opened this issue Nov 8, 2024 · 6 comments
Open

Vscode does not open links in default browser #233399

arijoon opened this issue Nov 8, 2024 · 6 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug linux Issues with VS Code on Linux snap Issues related to the snap package

Comments

@arijoon
Copy link

arijoon commented Nov 8, 2024

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version:
Version: 1.95.1
Commit: 65edc4939843c90c34d61f4ce11704f09d3e5cb6
Date: 2024-10-31T05:14:54.222Z
Electron: 32.2.1
ElectronBuildId: 10427718
Chromium: 128.0.6613.186
Node.js: 20.18.0
V8: 12.8.374.38-electron.0
OS: Linux x64 5.15.0-124-generic snap
  • OS Version:
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:        22.04
Codename:       jammy

Steps to Reproduce:

  1. Enter a link in the editor such as http://duckduckgo.com
  2. Ctrl+Click the link
  3. Wrong browser is used to open the link

My default browser is firefox and if if I enter the command open http://duckduckgo.com in the terminal, it opens it in the correct firefox window, but vscode uses the wrong browser (opens in chrome). This issue is recent and I've noticed it in v1.95.1, previously it worked fine

If you can provide detail on which mime type the links are using I can further inspect the default application for the mime type, text/html is correctly configured on firefox hence not sure where the issue lies. Other applications also open the correct browser and I've only noticed the issue with vscode

@gjsjohnmurray
Copy link
Contributor

Has a value been set for the workbench.externalBrowser setting?

@arijoon
Copy link
Author

arijoon commented Nov 8, 2024

Has a value been set for the workbench.externalBrowser setting?

No value set. Setting the value to firefox-trunk fixes it for me, but I assume that doesn't cover the case of not respecting the default browser (thanks for the suggestion as I didn't find this option earlier)

@Tyriar Tyriar assigned deepak1556 and hediet and unassigned Tyriar Nov 8, 2024
@hediet hediet removed their assignment Dec 9, 2024
@deepak1556
Copy link
Collaborator

We call xdg-open http://duckduckgo.com, what happens when you run the command in your terminal ?

@deepak1556 deepak1556 added the info-needed Issue requires more information from poster label Dec 11, 2024
@arijoon
Copy link
Author

arijoon commented Dec 12, 2024

We call xdg-open http://duckduckgo.com, what happens when you run the command in your terminal ?

For me running that command in the terminal runs it in the correct default browser

@deepak1556 deepak1556 added bug Issue identified by VS Code Team member as probable bug linux Issues with VS Code on Linux snap Issues related to the snap package and removed info-needed Issue requires more information from poster labels Dec 12, 2024
@ChaosCom
Copy link

I'm on 1.96.1 (windows) and experiencing a similar issue with CTRL+clicking links in the TERMINAL section of VSCode.
Via trial-and-error, I determined that CTRL+clicking a link opens the right or the wrong browser for me, depending on how that window was spawned:

  1. If I open a window and type "npm run dev" manually, CTRL+clicking a link opens the right browser. (The terminal window gets named "node" in that case)
  2. If I click on the triangle symbol in a package.json and choose the same env as in 1), CTRL+clicking a link opens the wrong browser. (The terminal window gets named "JavaScript Debug Terminal")

In the following image, you can see the effect (Brave is my default, but Chrome was opened when I did version 2):

Image

No resetting of "Apps > Default Apps" in Windows remediates this.
Maybe that tidbit of info helps narrow the problem down.

@OverHash
Copy link

We call xdg-open http://duckduckgo.com, what happens when you run the command in your terminal ?

I have two instances of Firefox (Snap and Flatpak), and this opens it in the correct instance. However, any links opened by vscode are in the incorrect variant.

Everything I can see across my distribution indicates that it is using the newer Firefox variant, so I'm not sure how to configure vscode to use the correct one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug linux Issues with VS Code on Linux snap Issues related to the snap package
Projects
None yet
Development

No branches or pull requests

7 participants