In a recently upgraded Ubuntu from 18.04 LTS to 20.04 LTS, when we try to open a directory with double click on it, the system opens the VSCode, but I don't know why.

How can set a different "open with" to directories?

Anyone have some clue about this situation?

1 Answer 1


I've been getting this since I installed vscode in Ubuntu 19.10 too. When I click on a link to my Downloads folder within the Gnome settings (Bluetooth settings) panel it opens up in vscode instead of my file manager. This appears to be due to an overzealous association of vscode with plain text and directory mime types.

I resolved this as follows:

sudo nano /usr/share/applications/code.desktop 

Then comment out the following line by placing a hash in front

# MimeType=text/plain;inode/directory;

Then update the application database

sudo update-desktop-database

Be warned that this change may need to be reapplied the next time you update vscode.

  • Thank you very much @whistler!!!!
    – benetj
    Jul 13, 2020 at 13:49
  • Please note that you don't need to comment out the whole line, but simply delete the 'inode/directory;' part. May 13, 2022 at 12:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.