There is an issue with VS Code, at least with the visual-studio-code-bin AUR package. Once you install it, whenever an application tries to open a folder, it opens with VS Code instead of the file manager application.

To fix the issue, you need to set the desktop entry of your file manager for inode/directory.

Verify The Issue

First, let’s verify, that this is indeed the issue you need to fix. Run this command to get the default application for opening directories:

xdg-mime query default "inode/directory"

If the output of this command is code.desktop, then continue following this guide. Otherwise, good luck googling more!

Solution

1. Get the Desktop Entry

Run this command to get all the desktop entries for the application that can open folders:

grep inode /usr/share/applications/mimeinfo.cache

Here are 2 example outputs for Gnome and KDE:

Gnome:

inode/directory=code.desktop;org.gnome.Nautilus.desktop;

Nautilus is the default file manager of Gnome so you need to choose org.gnome.Nautilus.desktop.

KDE

inode/directory=code.desktop;kfmclient_dir.desktop;org.kde.dolphin.desktop;org.kde.filelight.desktop;org.kde.gwenview.desktop;org.kde.kate.desktop;

As Dolphin is the default file manager for KDE, you need to choose org.kde.dolphin.desktop.

Similarly, choose the entry for your particular desktop and use it in the next command.

2. Set the Desktop Entry for Default

Enter the following command to set a new default:

xdg-mime default the.entry.desktop "inode/directory"

Change the.entry.desktop to the desktop entry of your file manager. For example:

Gnome:

xdg-mime default org.gnome.Nautilus.desktop "inode/directory"

KDE:

xdg-mime default org.kde.dolphin.desktop "inode/directory"

3. Verify

Verify the change by running this command:

xdg-mime query default "inode/directory"

It should output your file manager’s entry.