Fixing VS Code as default application for opening directories

After installing VS Code in my Arch Linux machine (using the AUR, 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 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
  • /usr/local/share/applications/mimeapps.list
  • /usr/share/applications/

(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
$ cat /usr/share/applications/mimeinfo.cache | grep directory

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)

Be the first to comment

Leave a Reply

Your email address will not be published.