exo-open fails when html filename contains spaces

Bug #1077970 reported by spapani
46
This bug affects 9 people
Affects Status Importance Assigned to Milestone
Exo
Fix Released
Medium
exo (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

When running the exo-open command with an html filename containing spaces, firefox fails to open the file as it considers that the request is to open two files.

Reproducible by running:

  echo '<html><body>Test</body></html>' > 'file name.html'
  exo-open 'file name.html'

which results in firefox opening one tab for 'file' and one for 'name.html'. Please note that this also affects the thunar file manager, so that double-clicking on 'file name.txt' again opens two tabs, instead of opening the correct file.

Interestingly, note that this does not happen for e.g. text files, so that

  echo 'Test' > 'file name.txt'
  exo-open 'file name.txt'

works as expected.

Please note that I have installed the 'Xubuntu desktop' using tasksel, after installing Ubuntu through mini.iso .

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: exo-utils 0.8.0-1
ProcVersionSignature: Ubuntu 3.5.0-18.29-generic 3.5.7
Uname: Linux 3.5.0-18-generic x86_64
ApportVersion: 2.6.1-0ubuntu6
Architecture: amd64
Date: Mon Nov 12 14:37:05 2012
MarkForUpload: True
SourcePackage: exo
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
spapani (stefanos-mechan) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in exo (Ubuntu):
status: New → Confirmed
Revision history for this message
Christian F. (mainhack) wrote :

Same thing on Xubuntu 12.04 (amd64) and I observed normal behaviour on a second try with firefox instance still / already opened. If FF isn't running, path is splitted into several tabs.

Revision history for this message
In , Theaterghost (theaterghost) wrote :

I traced the problem to this file: /usr/share/xfce4/helpers/firefox.desktop

When I changed the existing line:

X-XFCE-CommandsWithParameter=%B -remote "openURL(%s)";%B %s;

To this (adding quotes to %s):

X-XFCE-CommandsWithParameter=%B -remote "openURL(%s)";%B "%s";

the problem went away.

Revision history for this message
Davide Olianas (ubuntupk) wrote :

I'm affected by the same bug on xubuntu 14.04 amd64. Path is splitted whether or not Firefox is already running.

Changed in exo:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
Alad Wenter (the-changing-side) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package exo - 0.10.2-3ubuntu2

---------------
exo (0.10.2-3ubuntu2) utopic; urgency=medium

  * debian/patches
    - html-with-spaces.patch (LP: #1077970)
    - file-manager-inode-directory.patch (LP: #1310979)
 -- Alad Wenter <email address hidden> Fri, 25 Apr 2014 14:22:14 +0200

Changed in exo (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
In , Yves-Alexis Perez (corsac) wrote :

Can someone take a look a this?

Revision history for this message
urusha (urusha) wrote :

Not only firefox helper requires a fix. Here are the helpers that need it:
# grep -l '%s;' /usr/share/xfce4/helpers/*
/usr/share/xfce4/helpers/aterm.desktop
/usr/share/xfce4/helpers/debian-x-terminal-emulator.desktop
/usr/share/xfce4/helpers/firefox.desktop
/usr/share/xfce4/helpers/gnome-terminal.desktop
/usr/share/xfce4/helpers/icecat.desktop
/usr/share/xfce4/helpers/iceweasel.desktop
/usr/share/xfce4/helpers/links.desktop
/usr/share/xfce4/helpers/lynx.desktop
/usr/share/xfce4/helpers/mozilla-browser.desktop
/usr/share/xfce4/helpers/netscape-navigator.desktop
/usr/share/xfce4/helpers/nxterm.desktop
/usr/share/xfce4/helpers/sakura.desktop
/usr/share/xfce4/helpers/urxvt.desktop
/usr/share/xfce4/helpers/w3m.desktop
/usr/share/xfce4/helpers/xfce4-terminal.desktop
/usr/share/xfce4/helpers/xterm.desktop

Here is a proper fix:
# sed -i 's/%s;/"%s";/' /usr/share/xfce4/helpers/*

Please, backport it to trusty.

Revision history for this message
In , urusha (urusha) wrote :

Created attachment 5757
helpers.patch

I think all helpers should be fixed. Here is the patch.

Revision history for this message
In , Bluesabre-1 (bluesabre-1) wrote :
Changed in exo:
status: Confirmed → Fix Released
Revision history for this message
In , Evangelos Foutras (foutrelis) wrote :

Unfortunately, this patch breaks invocations such as the following:

$ exo-open --launch TerminalEmulator screen -S test

The resulting error is:

  Failed to execute child
  Failed to execute child process "screen -S test" (No such file or directory)

The expected outcome would be to open a terminal emulator window that executes the command "screen -S test".

'exo-open --help' confirms that this behavior is indeed incorrect:

=========
Else, if you specify the --launch option, you can select which preferred application you want to run, and pass additional parameters to the application (i.e. for TerminalEmulator you can pass the command line that should be run in the terminal).
=========

At least the changes to xfce4-terminal.desktop.in.in need to be reverted. I'm not sure how the other terminals behave but we could possibly test them.

Revision history for this message
In , Steve Dodier-Lazaro (sidi) wrote :

Reopening as the patch has had unwanted side effects, as per Evangelos' last comment

Revision history for this message
In , Evangelos Foutras (foutrelis) wrote :

Created attachment 6022
Don't quote arguments passed to terminal emulators

This is my proposed patch. It basically reverts the quoting changes made to all terminal emulator helpers except for Sakura which weirdly enough doesn't work without quotes.

I briefly checked all terminals except the Debian one and nxterm, and they behave correctly after the patch. If I remember correctly, qterminal and xterm also worked fine with quotes.

Changed in exo:
status: Fix Released → Confirmed
Revision history for this message
In , Landry-o (landry-o) wrote :

*** Bug 11634 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Bluesabre-1 (bluesabre-1) wrote :

Thanks for additional test and a new patch. Applied at http://git.xfce.org/xfce/exo/commit/?id=b4200c9bab9f60e61a100dd12d841c2588b360d8

Changed in exo:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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