Bug#922800: xdg-utils: xdg-open Opens File Browser on Wrong Display or Not at All When Used over X Forwarding

Neil Ormos ormos-deb1110 at ormos.org
Wed Feb 20 21:14:41 GMT 2019


Package: xdg-utils
Version: 1.1.3-1
Severity: normal

Dear Maintainer,

xdg-utils: xdg-open Opens File Browser on Wrong Display or Not at All When Used over X Forwarding


The behavior of xdg-open when invoked on a
directory appears to be inconsistent when used in
an SSH session with X11 forwarding.  I've tested
from a workstation ("local") with an X11 display,
connecting via ssh -X to a remote host ("remote",
running Debian Stretch) with the latest xdg-utils
available in Debian repositories, 1.1.3-1.  When I
type "xdg-open $HOME/test-directory" into a shell
on the remote host,

 the file browser window may open as expected on
 the display of the local workstation;

 the file browser window may open on the display
 of the remote host; or

 the file browser window does not open at all.

As a control, each of "nemo $HOME/test-directory" and
"nautilus $HOME/test-directory" opens a window on
the local workstation display showing the
corresponding file browser.

The behavior of "xdg-open $HOME/test-directory"
seems to depend on which file browser is set as
default for the "inode/directory" mime type.

If the mime configuation files are set to open
nemo for inode/directory, then the behavior I
expect occurs: a window opens on the local
workstation showing nemo.

If the mime configuration files are set to open
nautilus for inode/directory, then the behavior is
inconsistent (as best I can tell) and not what I
expect.  Either a nautilus window opens on the
display of the remote host (instead of the local
workstation), or no nautilus window appears on
either display.

When I do the same tests using a remote host
running Debian Jessie (xdg-utils
1.1.0~rc1+git2011121), the behavior of xdg-open is
as I expect regardless of which file browser is
set as the default for inode/directory--the file
browser window opens on the local workstation.


Steps to reproduce:

1.  On a workstation ("local") with an X11 display, open gnome-terminal.

2.  ssh -X user at remote

3.  setenv XDG_UTILS_DEBUG_LEVEL 2
    xdg-mime query default inode/directory

       Checking /home/nro/.config/mimeapps.list
       Checking /home/nro/.local/share/applications/mimeapps.list
       Checking /home/nro/.local/share/applications/defaults.list and /home/nro/.local/share/applications/mimeinfo.cache
       org.gnome.Nautilus.desktop

4.  nautilus $HOME/test-directory

>>>  Behavior is as expected:
>>>  Nautilus file browser opens on local
>>>  to display contents of $HOME/test-directory.

5.  xdg-open $HOME/test-directory

>>>  Behavior is not as expected.  Either:
>>>  (a) Nautilus file browser opens on *remote* display
>>>      (instead of local) to display the contents
>>>      of $HOME/test-directory;  OR
>>>  (b) Nautilus does not appear to open at all (but in
>>>      any case, it does not open on the local display).
>>>  I haven't discerned what governs which of (a) and (b)
>>>  happens.

6.  Change the [Default Applications] line for inode/directory to nemo.desktop in one of the configuration files.

7.  xdg-open $HOME/test-directory

>>>  Behavior is as expected:
>>>  Nemo file browser opens on local
>>>  to display contents of $HOME/test-directory.




-- Package-specific info:
Desktop environment: XDG_CURRENT_DESKTOP=

-- System Information:
Debian Release: 9.7
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.9.0-8-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C), LANGUAGE=en_US.UTF-8 (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

xdg-utils depends on no packages.

Versions of packages xdg-utils recommends:
ii  libfile-mimeinfo-perl  0.27-1
ii  libnet-dbus-perl       1.1.0-4+b1
ii  libx11-protocol-perl   0.56-7
ii  x11-utils              7.7+3+b1
ii  x11-xserver-utils      7.7+7+b1

xdg-utils suggests no packages.

-- no debconf information
-------------- next part --------------
> sh -x /usr/bin/xdg-open . 
+ check_common_commands .
+ [ 1 -gt 0 ]
+ parm=.
+ shift
+ [ 0 -gt 0 ]
+ [ -z  ]
+ unset XDG_UTILS_DEBUG_LEVEL
+ [ 0 -lt 1 ]
+ xdg_redirect_output= > /dev/null 2> /dev/null
+ [ x. != x ]
+ url=
+ [ 1 -gt 0 ]
+ parm=.
+ shift
+ [ -n  ]
+ url=.
+ [ 0 -gt 0 ]
+ [ -z . ]
+ detectDE
+ unset GREP_OPTIONS
+ [ -n  ]
+ [ x = x ]
+ [ x != x ]
+ [ x != x ]
+ [ x != x ]
+ dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager
+ 
+ DE=gnome
+ [ xgnome = x ]
+ [ xgnome = x ]
+ [ xgnome = xgnome ]
+ which gnome-default-applications-properties
+ DE=gnome3
+ [ -f /run/user/1000/flatpak-info ]
+ [ xgnome3 = x ]
+ DEBUG 2 Selected DE gnome3
+ [ -z  ]
+ return 0
+ open_gnome3 .
+ gio help open
+ gio open .
+ [ 0 -eq 0 ]
+ exit_success
+ [ 0 -gt 0 ]
+ exit 0



More information about the Pkg-freedesktop-maintainers mailing list