Visual Code fails to Open Containing Folder when installed with Snap

Bug #1894739 reported by silocoder
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Expired
Undecided
Unassigned

Bug Description

Attempting to Open Containing Folder from Visual Code fails when VC is installed with Snap. However it works without any issues when using apt get.

Here is full link of report to Visual Code team. https://github.com/microsoft/vscode/issues/106168

Any ideas?

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

Revision history for this message
Paweł Stołowski (stolowski) wrote :

Hello, I've tested Visual Studio Code snap on Ubuntu 20.04 and "Open Containing Folder" worked fine (with nautilus though).

A couple of questions:
- what is the path you expect it to open?
- are there any apparmor denials in system logs (look for apparmor="DENIED"...)
- do you have vs code snap & vs code deb installed at the same time? If so, please make sure you only have the snap installed.

Changed in snapd:
status: New → Incomplete
Revision history for this message
silocoder (silocoder) wrote :

Originally was just the snap version installed which I noticed the problem. Then I installed using apt and noticed that the apt version worked fine (see above the differences)

The path I am expecting to open is /usr/share/applications/org.kde.dolphin.desktop. Please remember this is KDE Plasma on Kubuntu so maybe there is difference.

Not sure if relevant but when I run the snapd Exec command manually I get this
$ env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/code_code.desktop /snap/bin/code --force-user-env --no-sandbox --new-window %F
Warning: 'sandbox' is not in the list of known options, but still passed to Electron/Chromium.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for snapd because there has been no activity for 60 days.]

Changed in snapd:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.