Scripts cannot be executed when the file path contains spaces

Bug #1600686 reported by aaronfranke
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
pcmanfm (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Scripts cannot be executed from PCManFM when the file path contains spaces.

For example, I have a folder called "/storage/Movies & Shows" and a file at "/storage/Movies & Shows/rename.sh" which is set to be executable. When I double-click on the file, and I click "Execute in Terminal", I get the two messages, each say "Failed to execute child process "/storage/Movies" (No such file or directory)" as seen in the attachment. If I close each window, I get a blank Terminal, leaving 2 Terminals left over in total.

Imgur album showing the steps and error: https://imgur.com/a/zohcM

What I expected to happen: The script would be executed in a Terminal.

What happened instead: The script could not be found because the file path contains spaces.

This bug should be easy enough to fix, all that would need is to add quotes around the file path of the command that runs the executables.

Temporary work-around: Tools -> Open Current Folder in Terminal -> Run the file manually.

Xubuntu 16.04 LTS
Description: Ubuntu 16.04 LTS
Release: 16.04

apt-cache policy pcmanfm
pcmanfm:
  Installed: 1.2.4-1
  Candidate: 1.2.4-1
  Version table:
 *** 1.2.4-1 500
        500 http://us.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
        100 /var/lib/dpkg/status

Revision history for this message
aaronfranke (arnfranke) wrote :
Revision history for this message
Lyn Perrine (walterorlin) wrote :

I unfortanetly cannot reproduce this bug so I will nead more information.
What filesystem is on /storage?

I tried this using both xfs and ext4 filesystems and it seemed to work.
IF you have a folder with spaces in your home folder does it not run this.

I got this to work with both ext4 and xfs.

Changed in pcmanfm (Ubuntu):
status: New → Incomplete
Revision history for this message
aaronfranke (arnfranke) wrote :

This issue occurs for me on both EXT4 and NTFS. I do not have any other filesystems to test, but I assume this bug exists on all of them.

I tried making a folder with spaces in my /home and putting a script in it, and I got the same error.

What is in your text box at "Edit -> Preferences -> Advanced -> Terminal emulator"? Mine is "x-terminal-emulator %s" which is the default. It just now occurred to me that changing this field's default contents may be the solution to this bug.

Revision history for this message
alex123 (alekcacko-deactivatedaccount) wrote :

I can confirm this bug. I am using PCManFM on:
Ubuntu 15.10 with i3.

Changed in pcmanfm (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
alex123 (alekcacko-deactivatedaccount) wrote :

EDIT:

~$ apt-cache policy pcmanfm
pcmanfm:
  Installed: 1.2.3-1.1
  Candidate: 1.2.3-1.1
  Version table:
 *** 1.2.3-1.1 0
        500 http://us.archive.ubuntu.com/ubuntu/ wily/universe amd64 Packages
        100 /var/lib/dpkg/status

Revision history for this message
LStranger (andrej-rep) wrote :

I believe it is not a PCManFM issue but your chosen terminal instead. Try change terminal emulator to another one in settings, please, and report back if that fixes your issue (I believe it will). Then reassign this report to the terminal emulator which fails, please.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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