After installing VS Code in my Arch Linux machine (using the AUR https://aur.archlinux.org/packages/visual-studio-code-bin/), every time I tried to open a directory from any application, it’d be opened by Code instead of my default file manager.
My default manager is currently Thunar, before it I was using SpaceFM (quite good but decided to switch after some stability issues – crashes).
I found some similar issues here:
These gave some cues and after following some links I got to https://wiki.archlinux.org/index.php/XDG_MIME_Applications#Shared_MIME_databasem where I could see that there are serveral files where the default applications for each MIME type are stored:
- ~/.config/mimeapps.list: user overrides
- /etc/xdg/mimeapps.list: system-wide overrides
(There’s also ~/.local/share/applications/mimeapps.list, but the Wiki page indicates it’s deprecated).
Searching my system for those files, I only found ~/.config/mimeapps.list and /usr/share/applications/mimeapps.list, their content with a directory configuration:
$ cat ~/.config/mimeapps.list | grep directory inode/directory=spacefm-folder-handler.desktop; inode/directory=spacefm-folder-handler.desktop;
$ cat /usr/share/applications/mimeinfo.cache | grep directory inode/directory=visual-studio-code.desktop;Thunar-folder-handler.desktop;
My user mimeapps.list file still had SpaceFM as default configuration, and the cache system wide one includes VS Code and Thunar, what I think was happening is that, as SpaceFM no longer exists in my sistem, it uses the next one it finds, which seems to be VS Code.
I edited ~/.config/mimeapps.list file replacing the spacefm entries with only one like this:
After saving the file, everything works again as expected (tried with the “Show in folder” command in Chromium, the “Open Containing Folder” command in Firefox and the xdg-open directory command)