After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 771276 - "Open in Terminal" duplicated in nautilus right click menu
"Open in Terminal" duplicated in nautilus right click menu
Status: RESOLVED FIXED
Product: gnome-terminal
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
: 775572 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-09-12 08:50 UTC by Pavel Grunt
Modified: 2017-10-31 09:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot (45.30 KB, image/png)
2016-09-12 08:50 UTC, Pavel Grunt
  Details
fix-duplicated-open-menus.patch (2.03 KB, patch)
2017-07-22 05:09 UTC, Jason Crain
none Details | Review

Description Pavel Grunt 2016-09-12 08:50:24 UTC
Created attachment 335341 [details]
screenshot

Hi,
in nautilus the context menu contains two entries for "Open in Terminal" for webdav folder (see the attachment).
Both entries work fine. "Normal" folders don't have this problem.

Versions:
nautilus-3.20.2-1.fc24.x86_64
gnome-terminal-3.20.2-2.fc24.x86_64
Comment 1 Debarshi Ray 2016-09-12 09:02:41 UTC
The duplicate "open in terminal" entry used to be due to both gnome-terminal-nautilus and nautilus-open-terminal being installed. Since gnome-terminal-nautilus is the one users are meant to use, we tweaking the Fedora package to obsolete nautilus-open-terminal. I wonder if that didn't work for some reason? Or is this something else?
Comment 2 Debarshi Ray 2016-09-12 09:03:22 UTC
(In reply to Debarshi Ray from comment #1)
> we tweaking the Fedora package

*tweaked
Comment 3 Pavel Grunt 2016-09-12 09:09:39 UTC
(In reply to Debarshi Ray from comment #1)
> The duplicate "open in terminal" entry used to be due to both
> gnome-terminal-nautilus and nautilus-open-terminal being installed. Since
> gnome-terminal-nautilus is the one users are meant to use, we tweaking the
> Fedora package to obsolete nautilus-open-terminal. I wonder if that didn't
> work for some reason? Or is this something else?

Rishi, I think it is something different since only the webdav folder is affected (and I don't have nautilus-open-terminal installed)
Comment 4 Debarshi Ray 2016-09-12 13:30:47 UTC
(In reply to Pavel Grunt from comment #3)
> (In reply to Debarshi Ray from comment #1)
> > The duplicate "open in terminal" entry used to be due to both
> > gnome-terminal-nautilus and nautilus-open-terminal being installed. Since
> > gnome-terminal-nautilus is the one users are meant to use, we tweaking the
> > Fedora package to obsolete nautilus-open-terminal. I wonder if that didn't
> > work for some reason? Or is this something else?
> 
> Rishi, I think it is something different since only the webdav folder is
> affected (and I don't have nautilus-open-terminal installed)

You are right. I can reproduce it too.
Comment 5 Christian Persch 2016-12-07 20:06:11 UTC
*** Bug 775572 has been marked as a duplicate of this bug. ***
Comment 6 Jason Crain 2017-07-22 04:13:23 UTC
I saw a bug report about this on Debian, https://bugs.debian.org/765369#15.  The "Open in Terminal" option also shows up twice for SMB shares.  I think that this has always been a problem in gnome-terminal's nautilus plugin, but old versions of nautilus and GTK would reject duplicate menu entries with a "Refusing to add non-unique action" warning.

It comes from this section of terminal_nautilus_get_background_items in terminal-nautilus.c:

  if (terminal_file_info == FILE_INFO_SFTP ||
      terminal_file_info == FILE_INFO_DESKTOP ||
      uri_has_local_path (uri)) {
    /* local locations or SSH */
    item = terminal_nautilus_menu_item_new (nautilus,
                                            file_info, 
                                            terminal_file_info, 
                                            gtk_widget_get_screen (window),
                                            FALSE, 
                                            terminal_file_info == FILE_INFO_SFTP, 
                                            FALSE);
    items = g_list_append (items, item);
  }

  if ((terminal_file_info == FILE_INFO_SFTP ||
        terminal_file_info == FILE_INFO_OTHER) &&
      uri_has_local_path (uri)) {
    /* remote locations that offer local back-mapping */
    item = terminal_nautilus_menu_item_new (nautilus,
                                            file_info, 
                                            terminal_file_info, 
                                            gtk_widget_get_screen (window),
                                            FALSE, 
                                            FALSE, 
                                            FALSE);
    items = g_list_append (items, item);
  }

FILE_INFO_OTHER files, as long as they have a local path, will have two menus created.
Comment 7 Jason Crain 2017-07-22 05:09:34 UTC
Created attachment 356154 [details] [review]
fix-duplicated-open-menus.patch

This is my attempt to fix this.  This modifies the two menu_item_new statements so that the first statement only applies to SSH URIs and the second applies to all local and locally-mappable URIs.  This fixes the duplicate menu entries in google-drive and smb shares for me without regressions for ssh or local files, though I couldn't find any FILE_INFO_DESKTOP URIs to test with.
Comment 8 Hussam Al-Tayeb 2017-07-23 09:32:47 UTC
No more duplicate 'open in terminal' with usb sticks or network mounts with this patch. Thank you!
Comment 9 Hussam Al-Tayeb 2017-09-04 19:11:49 UTC
Perhaps someone can take a look at the patch. I've been using it till today with no visible regressions.