Search code examples
google-chromevisual-studio-codechromiumlinux-mintfile-management

Prevent opening Visual Studio Code when click Show In Folder in Chrome


I've been googling and fighting this for a half a day already.

When I download something in Google Chrome I want to go to the folder with a file. But when I press 'Show in folder' a Visual Studio Code starts instead of my Thunar. How can I fix this?

Firefox opens folders ok but Chromium, Google-Chrome and Opera kicks of Visual Studio Code.

My system is Linux Mint Tara. I've already tried some things. Like added

[Default Applications]
inode/directory=Thunar.desktop

to /home/[user]/.config/mimeapps.list

Completely removed code.desktop from /usr/share/applications/mimeinfo.cache

Ran xdg-mime default Thunar.desktop inode/directory and the output of xdg-mime query default inode/directory is Thunar.desktop!!!

Even fully removed code.desktop from filesystem. Nothing worked!

Please help, this annoys me so much.


Solution

  • This is caused by MimeType=text/plain;inode/directory; which can be found in /usr/share/applications/code.desktop for what I can find.

    What fixed it for me is changing this line to MimeType=text/plain; and removing code.desktop from /usr/share/applications/mimelist.cache

    EDIT
    A more permanent solution i've found is the following.
    add inode/directory=org.gnome.Nautilus.desktop to the ~/.local/share/applications/mimeapps.list file.
    After doing this make sure to the inode/directory entry is the same or not present at all in ~/.local/share/applications/mimelist.cache' and /usr/share/applications/mimelist.cache

    org.gnome.Nautilus.desktop can be replaced by your preferred file explorer if you don't use Nautilus.

    You might need to restart your desktop environment for the changes to apply.