Folders are opened in vscode

Hello all,

I reinstalled endeavouros a few days ago and now a strange behavior.
When I want to open a folder from a program, it opens in vscode instead of the file browser.
Generally everything that is not configured seems to be opened with vscode.
How can I change this?

So under org.gnome.shell favorite-apps I have the following
['firefox.desktop', 'org.gnome.Nautilus.desktop', 'org.gnome.Console.desktop', 'org.gnome.TextEditor.desktop']

and this is my mimeapps.list:

[Added Associations]
x-scheme-handler/sms=org.gnome.Shell.Extensions.GSConnect.desktop;
x-scheme-handler/tel=org.gnome.Shell.Extensions.GSConnect.desktop;
image/bmp=org.gnome.eog.desktop;
image/gif=org.gnome.eog.desktop;
image/jpg=org.gnome.eog.desktop;
image/pjpeg=org.gnome.eog.desktop;
image/png=org.gnome.eog.desktop;
image/tiff=org.gnome.eog.desktop;
image/webp=org.gnome.eog.desktop;
image/x-bmp=org.gnome.eog.desktop;
image/x-gray=org.gnome.eog.desktop;
image/x-icb=org.gnome.eog.desktop;
image/x-ico=org.gnome.eog.desktop;
image/x-png=org.gnome.eog.desktop;
image/x-portable-anymap=org.gnome.eog.desktop;
image/x-portable-bitmap=org.gnome.eog.desktop;
image/x-portable-graymap=org.gnome.eog.desktop;
image/x-portable-pixmap=org.gnome.eog.desktop;
image/x-xbitmap=org.gnome.eog.desktop;
image/x-xpixmap=org.gnome.eog.desktop;
image/x-pcx=org.gnome.eog.desktop;
image/svg+xml=org.gnome.eog.desktop;
image/svg+xml-compressed=org.gnome.eog.desktop;
image/vnd.wap.wbmp=org.gnome.eog.desktop;
image/x-icns=org.gnome.eog.desktop;
application/pdf=org.gnome.Evince.desktop;
x-scheme-handler/http=firefox.desktop;
text/html=firefox.desktop;
application/xhtml+xml=firefox.desktop;
x-scheme-handler/https=firefox.desktop;
text/plain=org.gnome.TextEditor.desktop;

[Default Applications]
image/jpeg=org.gnome.eog.desktop
image/bmp=org.gnome.eog.desktop
image/gif=org.gnome.eog.desktop
image/jpg=org.gnome.eog.desktop
image/pjpeg=org.gnome.eog.desktop
image/png=org.gnome.eog.desktop
image/tiff=org.gnome.eog.desktop
image/webp=org.gnome.eog.desktop
image/x-bmp=org.gnome.eog.desktop
image/x-gray=org.gnome.eog.desktop
image/x-icb=org.gnome.eog.desktop
image/x-ico=org.gnome.eog.desktop
image/x-png=org.gnome.eog.desktop
image/x-portable-anymap=org.gnome.eog.desktop
image/x-portable-bitmap=org.gnome.eog.desktop
image/x-portable-graymap=org.gnome.eog.desktop
image/x-portable-pixmap=org.gnome.eog.desktop
image/x-xbitmap=org.gnome.eog.desktop
image/x-xpixmap=org.gnome.eog.desktop
image/x-pcx=org.gnome.eog.desktop
image/svg+xml=org.gnome.eog.desktop
image/svg+xml-compressed=org.gnome.eog.desktop
image/vnd.wap.wbmp=org.gnome.eog.desktop
image/x-icns=org.gnome.eog.desktop
application/pdf=org.gnome.Evince.desktop
x-scheme-handler/http=firefox.desktop
text/html=firefox.desktop
application/xhtml+xml=firefox.desktop
x-scheme-handler/https=firefox.desktop
text/plain=org.gnome.TextEditor.desktop

Sure I could just change this for the folders, but Iā€™m also interested in where the information comes from that everything is opened with vscode.

inode/directory=org.gnome.Nautilus.desktop
inode/symlink=org.gnome.Nautilus.desktop

I think the vscode association comes from /usr/share/applications/mimeinfo.cache.
To change it, just add the desired association to mimeapps.list either in ~/.config/ (user-level override) or /etc/xdg/ (system-wide).

Could it be this one?

@klv
The only entry in the cache file that contains vscode is the following:
x-scheme-handler/vscode=codium-uri-handler.desktop;

if I have not overlooked anything, it also only says that I should make an entry in the mimeapps.list for folders.

But my problem goes a little further because all unknown files are opened with vscode.

All I can say is that I had a similar problem, where folders were opened in Code. I suspected it had something to with this line in mimeinfo.cache:
inode/directory=code.desktop;org.gnome.Nautilus.desktop;

The problem went away when I added the correct association to ~/.config/mimeapps.list under [Default Applications]:
inode/directory=org.gnome.Nautilus.desktop;

But it might be your problem is a bit different from mine.

1 Like

execute from cli:

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