microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.97k stars 29.19k forks source link

Snap: Open Containing Folder does nothing in Kubuntu / KDE but works with Sublime-Text and Kate. #106168

Closed silocoder closed 3 years ago

silocoder commented 4 years ago

Steps to Reproduce:

  1. Navigate to any file in Visual Code Explorer and Right Click
  2. Select Open Containing Folder.
  3. Dolphin file manager should open up. It does not!

Does this issue occur when all extensions are disabled?: Yes

P.S. This same open containing folder works with Sublime-Text 3 AND Kate (the default Kubuntu text editor)

Here is mime stuff:

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

$ cat /usr/share/applications/mimeinfo.cache | grep inode/directory
inode/directory=org.kde.dolphin.desktop;org.kde.gwenview.desktop;

$ xdg-open ~/Documents  # Works fine and opens Dolphin file manager
silocoder commented 4 years ago

Additional info:

Tested using Linux Mint 20 (also Ubuntu based) and works fine with visual code opens up nemo.

Here are the xdg

~$ xdg-mime query default inode/directory  
nemo.desktop

~$ cat /usr/share/applications/mimeinfo.cache | grep inode/directory
inode/directory=code.desktop;nemo.desktop;org.gnome.Nautilus.desktop;org.gnome.baobab.desktop;org.kde.dolphin.desktop;

~$ xdg-open ~/Documents  # works 
silocoder commented 4 years ago

Found the problem. Seems to be the packaging/installation when using Snap. If I use apt install works. Below are the meta data. Versions are the same.

Also if I change /snap/bin/code with /usr/share/code/code exec then it works.

Any thoughts?

==========

Snap install fails to open containing folder.

#code_code.desktop
-------------------
[Desktop Entry]
X-SnapInstanceName=code
Name=Visual Studio Code
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/code_code.desktop /snap/bin/code --force-user-env --no-sandbox --unity-launch %F
Icon=/snap/code/42/meta/gui/com.visualstudio.code.png
Type=Application
StartupNotify=false
StartupWMClass=Code
Categories=Utility;TextEditor;Development;IDE;
MimeType=text/plain;inode/directory;
Actions=new-empty-window;
Keywords=vscode;

[Desktop Action new-empty-window]
Name=New Empty Window
Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/code_code.desktop /snap/bin/code --force-user-env --no-sandbox --new-window %F
Icon=/snap/code/42/meta/gui/com.visualstudio.code.png

# version
------------
Version: 1.48.2
Commit: a0479759d6e9ea56afa657e454193f72aef85bd0
Date: 2020-08-25T10:56:10.074Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Linux x64 5.4.0-45-generic snap

==========

apt install works correctly and opens containing folder with dolphin

# code.desktop
------------
[Desktop Entry]
Name=Visual Studio Code
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=/usr/share/code/code --no-sandbox --unity-launch %F
Icon=com.visualstudio.code
Type=Application
StartupNotify=false
StartupWMClass=Code
Categories=Utility;TextEditor;Development;IDE;
MimeType=text/plain;inode/directory;
Actions=new-empty-window;
Keywords=vscode;

X-Desktop-File-Install-Version=0.24

[Desktop Action new-empty-window]
Name=New Empty Window
Exec=/usr/share/code/code --no-sandbox --new-window %F
Icon=com.visualstudio.code

# version
---------
Version: 1.48.2
Commit: a0479759d6e9ea56afa657e454193f72aef85bd0
Date: 2020-08-25T10:56:10.074Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Linux x64 5.4.0-45-generic
isidorn commented 4 years ago

I am sorry but I do not know how the snap install could cause this. Maybe @joaomoreno would know And I can keep this issue open for the community to chime in with potential solutions

silocoder commented 4 years ago

I added it to snapd bugsite

https://bugs.launchpad.net/snapd/+bug/1894739