Skip to content

Allow code to open directories in nautilus file manager #15741

@nullvoidptr

Description

@nullvoidptr
  • VSCode Version: 1.7.1
  • OS Version: Ubuntu 16.04

The nautilus file manager in Ubuntu and other GNOME-based Linux distros has a right click "Open with" option available for opening files and or directories. Currently, vscode supports open with for text files but not directories. Since I often open code repositories with vscode, it would be nice to be able to right click and select "open with ... " and then chose "code" to open a new instance of vscode using the directory.

Steps to Reproduce:

  1. In nautilus, choose a folder. Right click and select "open with" submenu
  2. Visual Studio Code is not listed in submenu.

If you repeat above with a plain text file, it works.

Nautilus uses the MimeType defined in the *.desktop file for associating applications with a particular file type. For directories, the desired mime-type is inode/directory. Simply changing the following line in code.desktop from

MimeType=text/plain;
to
MimeType=text/plain;inode/directory;

should suffice (though it may be necessary to log in/log out to have change take effect ... alternatively running update-desktop-database and restarting nautilus may work.

Metadata

Metadata

Assignees

Labels

linuxIssues with VS Code on Linuxunder-discussionIssue is under discussion for relevance, priority, approachworkbench-os-integrationNative OS integration issues

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions