Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
VS Code messes with Linux places paths. VS Code is opened instead of system path. #41037
The "Places" extension is a really popular extension that adds a menu for quickly navigating places in the system. It is activated by default on most Linux Gnome distributions.
After installing VS Code, anything opened using the "Places" extension opens VS Code instead of the default folder / path.
Steps to Reproduce:
This happens because we register vscode as an opener of folders in the desktop file. If anyone knows a way to deprioritize or something we can do that but it would be too big of a regression to remove this feature from other, AFAICT behaving distros.
This is the "problem" line:
Just wanted to follow up on this issue because I get the same behavior.
I also set nautilus as the default for
➜ xdg-mime default nautilus.desktop inode/directory ➜ xdg-mime query default inode/directory nautilus.desktop
but it still doesn't work.
Then I looked for the distribution-provided defaults for
➜ cat /usr/share/applications/mimeinfo.cache | grep inode/directory inode/directory=visual-studio-code.desktop;org.gnome.Nautilus.desktop;
and it seems the order here does matter, changing it to
fixes the issue.
Sadly I'm not an expert in this field so I can't tell you if you can influence this or if this needs to be done after every update (I hope not because vs code is still registered).
It might be even a issue with
➜ xdg-mime query default text/plain gedit.desktop ➜ cat /usr/share/applications/mimeinfo.cache | grep text/plain text/plain=visual-studio-code.desktop;org.gnome.gedit.desktop; ➜ xdg-open ~/some.txt
Copying over my response from #44344
I'm answering here instead of #44344.
@Tyriar I don't think it is really an issue with VS Code.
And as I mentioned before
I think this is a bug with
I'm not sure where this should be reported instead, but I don't think you can do something about it (except for not registering
Just verified this by installing another file manager (
➜ xdg-mime query default inode/directory nautilus.desktop ➜ cat /usr/share/applications/mimeinfo.cache | grep inode/directory inode/directory=vifm.desktop;visual-studio-code.desktop;org.gnome.Nautilus.desktop; ➜ xdg-open ~/Documents
Now it opens
I know the issue is closed but the problem still affects me and I want to add some info here in case someone else stumbles upon this issue.
Note: I'm also using Gnome-shell (3.26.2) on Antergos, like the OP, and I don't recall having the problem on Ubuntu, so the problem is likely to affect Antergos and maybe Arch Linux.
The standard for default applications is to look for the first entry in one of several mimeapps.list files; if the first entry isn't available (uninstalled, etc.), the next is tried. Order does matter. On my machine, I have a
(or just the second line if there is already a
I think this is indeed a problem with the distribution and not VSCode
Should be fixed in Antergos (see Antergos/antergos-packages#299)
Update your packages and test (but see here if you have trouble: https://forum.antergos.com/topic/9464/antergos-gnome-defaults-list)