Vscode: I set Dolphin as default file manager, but VSCode opens Nautilus instead of Dolphin

Created on 24 May 2018  路  42Comments  路  Source: microsoft/vscode

  • VSCode Version: 1.24.0-insider
  • OS Version: Ubuntu 18.04 with GNOME, KDE, Unity and XFCE

Steps to Reproduce:

  1. I set Dolphin as default file manager via command and in the defaults.list.
  2. I open VSCode Insiders
  3. I open a folder
  4. VSCode opens Nautilus instead of Dolphin

VSCode does not recognise that Dolphin is a new default file manager.

Does this issue occur when all extensions are disabled? Yes

electron linux upstream upstream-issue-linked

Most helpful comment

In multiple Linux distros using KDE/plasma with kdialog (mint,arch/manjaro, kubuntu ) chrome and chromium use the default file browser (dolphin), but in none of these distros code uses it. It still uses a GTK based dialog, so that's not a solution.
Also, addressing @begusbemacbe comment, firefox uses a gtk-based dialog but the solution listed in the arch wiki works, that's using xdg-desktop-portal and editing its .desktop file. So all these non-kde apps may use dolphin to open files, isn't the case for vscode.

All 42 comments

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@gusbemacbe what do you mean by step 3 "open a folder"?

"Opening a folder" in VS Code means clicking on the folder in the explorer (and that works fine for me).

Inside VSCode, I selected File -> Open Folder ...

Aha, you mean VS Code uses the wrong "open file dialog".

I'm also facing same problem

@weinand and @bpasero, the same problem still insists. I am using Deepin OS and Manjaro, VSCode opens the ugly X11/Xorg-based Nautilus instead of Deepin File (Deepin OS's default file manager) and Dolphin (Manjaro's).

@gusbemacbe did you try with our latest insider release that comes with Electron 2.0.x and GTK3 support? Just wondering if that would change anything here.

@bpasero

Sorry for my absence, I was sick.

ON Manjaro, it supports perfectly GTK3, but it still opens Nautilus instead of Dolphin File.

On Deepin OS, it does not support GTK3, and still also opens Nautilus instead of Deepin File Manager.

Still an issue.

Would be nice if VSCode just used the default file manager or if there was at least a setting for changing this manually. Nautilus can be used, but it does not integrate well in KDE, it sometimes is quite annoying.

@bpasero

Please recommend to me better solution for this issue. I want to use deepin file manager but vscode runs.

Same problem here

Seems not to be fixed yet. Could you reopen the issue and (if you agree) remove the "more info needed" tag? @gusbemacbe @bpasero

I called him twice. This issue passed one year. Nobody considered this issue as important. I am already used to use GTK-based dialg in KDE.

It is the moderator who will decide or not to reopen.

+1

I have the same problem on Kubuntu 18.04 as well.

Me too. I am using Deepin 15.9.2

How does VS Code communicate with the operating system's file manager, I wonder? If someone could point me to the code that does this it'd be great.

@chrisshyi

As VSCode is written in GTK, it will use GTK2-based Xorg dialog. The GTK-based apps can not communicate with non-GTK standard file managers. To open the KDE-based dialog or Dolphin as a standard file manager, VSCode needs to be written in QT.

@gusbemacbe

I see, that really clarifies things. Would you mind pointing me to where the GTK part of the source code resides? I'd love to learn more about how VSCode works internally.

Thanks!

VSCode is not built with GTK but with TypeScript with packaging and run time via Electron. Electron needs to be updated to be aware of its desktop environment. Every Electron app has this issue - ie its an upstream issue and not VSCode - https://github.com/electron/electron/issues/2911#issuecomment-429474776

@chrisshyi

VSCode uses Electron and Nodejs, which compiles only for GTK.

https://github.com/Microsoft/vscode/blob/0fde6619172c9f04c41f2e816479e432cc974b8b/build/azure-pipelines/linux/continuous-build-linux.yml#L5

But @sylveon, which is responsible for making VSCode's transparency compatible with KDE, must know how to solve it.

Like VSCode, on KDE, Firefox, Google, Inkscape, etc., are GTK-based and open the GTK2-based Xorg dialog.

@sylveon

I installed kgtk-wrapper, tested it with VSCode and it did not work. And kgtk does not support GTK3-based apps, as Inkscape.

That article mentions kdialog for Chromium. Since Electron uses Chromium, I'd expect it to work.

In multiple Linux distros using KDE/plasma with kdialog (mint,arch/manjaro, kubuntu ) chrome and chromium use the default file browser (dolphin), but in none of these distros code uses it. It still uses a GTK based dialog, so that's not a solution.
Also, addressing @begusbemacbe comment, firefox uses a gtk-based dialog but the solution listed in the arch wiki works, that's using xdg-desktop-portal and editing its .desktop file. So all these non-kde apps may use dolphin to open files, isn't the case for vscode.

Yeah this is definitely possible, since it works for firefox and other apps. Anyone know is this is an issue with Electron or VSCode?

Thumbs up the first post, although this is closed i think that's the only way to bring some attention to this. It should be possible, but it seems clear that it isn't important for this project.

This is an Electron issue. I do prefer if I could use Dolphin.

It seems that there is a truck used by IntelliJ IDEA developers:

message()
{
  TITLE="Cannot start IntelliJ IDEA"
  if [ -n "$(command -v zenity)" ]; then
    zenity --error --title="$TITLE" --text="$1" --no-wrap
  elif [ -n "$(command -v kdialog)" ]; then
    kdialog --error "$1" --title "$TITLE"
  elif [ -n "$(command -v notify-send)" ]; then
    notify-send "ERROR: $TITLE" "$1"
  elif [ -n "$(command -v xmessage)" ]; then
    xmessage -center "ERROR: $TITLE: $1"
  else
    printf "ERROR: %s\n%s\n" "$TITLE" "$1"
  fi
}

@bpasero

There is something interested that drew my attention. I used Gitahead, that used Dolphin dialog instead of X dialog:

gitahead

But Gitahead is not an Electron-based.

And SVG Cleaner opens the KDE dialog instead too:

svg-cleaner

We are building exploration builds that use a much newer version of our UI framework (Electron version 6.0.x). I wonder if this issue reproduces with one of these builds, could you try? Download:

I am on Arch Linux with KDE, the which uses pacman or AUR, but I installed manually the package. It seems that it does not work yet. I will test yet.

image

In the second test, I installed via rm installed from AUR, and installed Electron 6, but it was still the same thing.

Maybe better I test on Fedora with KDE.

@gusbemacbe thanks, would you be willing to test out Electron bare (without VSCode) to see if it reproduces? I can guide you through it, but you would need to install Electron Fiddle: https://electronjs.org/fiddle

In the third test, on Fedora with KDE, it is still the same problem. It does not open Dolphin instead.

I installed Electron Fiddle, and ran the run, it still opens the awful GTK dialog instead:

image

Maybe you create two versions of VSCode for Linux, one for any KDE/QT-based environment, and another version for any GTK-based environment, like the openSUSE developers created the KDE version of Firefox.

@gusbemacbe thanks, would you be willing to test out Electron bare (without VSCode) to see if it reproduces? I can guide you through it, but you would need to install Electron Fiddle: https://electronjs.org/fiddle

@bpasero, you duplicated the same text. I have already tested on Fiddle.

@gusbemacbe great, can you report this as issue then to Electron? See https://github.com/atom/electron

@bpasero, ready.

Same problem.

I'm running into this issue as well. I'm on Manjaro KDE. Was there a solution?

Was this page helpful?
0 / 5 - 0 ratings