Skip to content

Electron uses old and deprecated trash implementation that is not available on recent gvfs versions. #15011

Closed

Description

@eli-schwartz

On Linux, with distributions that ship gvfs >= 1.37.2, the builtin trash implementation does not work.

Rather than moving files to the trash, a popup appears warning that Electron "failed to delete using the trash. Do you want to permanently delete instead?"

The root of this issue is that the trash implementation runs a subprocess with a given $ELECTRON_TRASH command that handles the actual trash implementation. Electron supports several different trash implementations, via an undocumented environment variable, but for the use case of the average person, it will either use kioclient move on KDE desktops (which works), or gvfs-trash everywhere else.

The problem is that since gvfs 1.31.1, released in October 2016, the gvfs-trash command was replaced with a shell script that printed the following error message to stderr:

This tool has been deprecated, use 'gio trash' instead.
See 'gio help' for more info.

Then executed gio trash as a compatibility shim.

In the two years since then, the gvfs project decided they've given people enough time to migrate onto the supported tool, and they removed the compatibility shims in 1.37.2 (released in May).

Downstream distributions are now beginning to provide versions of gvfs which do not have this compatibility shim. As a result, electron cannot find it and thinks there is no functional trash implementation for it to use.

Note also that in #9518 support was added for the $ELECTRON_TRASH undocumented environment variable to be set to "gio" and thereby use the correct, modern trash implementation. However, this is obviously not very good UX at all and Electron remains broken by default.

Please switch the default implementation to use gio.

Activity

  1. added
    status/confirmed
    on Oct 8, 2018
  2. self-assigned this
    on Oct 25, 2018
  3. codebytere commented on Oct 25, 2018

    @codebytere
    Member

    I'll get a PR up for this today!

  4. pzmarzly commented on Oct 28, 2018

    @pzmarzly

    Shouldn't it also get backported to 2-0-x, as it is also affected (Atom seems to be using that branch)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

platform/linuxstatus/confirmed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions