Ubuntu

Execute in terminal not working

Reported by Louis M on 2012-04-06
72
This bug affects 13 people
Affects Status Importance Assigned to Milestone
pcmanfm (Ubuntu)
Undecided
Unassigned

Bug Description

Hi, I'm using Lubuntu (11.10 and 12.04 has the same problem). When I create a simple shell script, I cannot use the "Execute in terminal" option in pcmanfm. Reproducing the bug is simple. Create a simple shell script. Ex:

#!/bin/sh
leafpad

Then, put this script executable. Execute the script in pcmanfm (double click or right click and open). On the window that open, if you use "Execute", the "Leafpad" application start correctly. But if you use the "Launch in terminal" option, nothing happens (no bug report or error message).

Also, I have another bug that, I think, is related to this bug. If I have a desktop shortcut file (.desktop file) and in that file, the "Terminal=true" option is there. When I execute this shortcut in pcmanfm, nothing happens again. If I remove the option, everything works fine.

Thank you for your hard work!

Louis M

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: pcmanfm 0.9.10-0ubuntu2
ProcVersionSignature: Ubuntu 3.2.0-22.35-generic 3.2.14
Uname: Linux 3.2.0-22-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.0-0ubuntu4
Architecture: amd64
Date: Fri Apr 6 09:26:09 2012
ExecutablePath: /usr/bin/pcmanfm
InstallationMedia: Lubuntu 12.04 "Precise Pangolin" - Beta amd64 (20120405)
Pref_Config_System_lubuntu:
 [Preferred Applications]
 WebBrowser=firefox.desktop
 MailClient=
ProcEnviron:
 LANGUAGE=fr_CA:fr
 PATH=(custom, no user)
 LANG=fr_CA.UTF-8
 SHELL=/bin/bash
SourcePackage: pcmanfm
UpgradeStatus: No upgrade log present (probably fresh install)

Louis M (tioui) wrote :
Launchpad Janitor (janitor) wrote :

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

Changed in pcmanfm (Ubuntu):
status: New → Confirmed
Christophe C (batra3) wrote :

hi, i've the same problem on lubuntu 12.04. I don't know for 11.10.

Peter Curtis (secondary) wrote :

Same problem after I switched to Lubuntu from Ubuntu.

I keep a few scripts on the desktop for common actions such as rebuilding wifi drivers so this is inconvenient.

A workround until this is fixed is to create launchers (.desktop files) on the Desktop for the scripts which explicitly start the script in the terminal by an entry such as Exec=lxterminal -e "bash /home/yourusername/rtl8192cu.sh" - Note ~/ and $HOME do not seem to work in the path to the script. lxshortcut can be used to create launchers.

Peter Curtis (secondary) wrote :

I think I have found the problem - the default setting for the terminal is wrong in Lubuntu. Do Edit -> Preferences -> Advanced Tab and add the option -e to the string so it reads "x-terminal-emulator -e %s" - this calls lxterminal with the -e option which opens the terminal and executes the command line in %s. See man lxterminal. For more clarity change the string to "lxterminal -e %s"

jahst (christopherbowhuis) wrote :

Peter Curtis' solutions worked for me.

pcmanfm -> Edit -> Preferences -> Advanced Tab

I just had to change

x-terminal-emulator %s
into
x-terminal-emulator -e %s

changing

x-terminal-emulator -e %s
into
lxterminal -e %s

also works... any advantage to one over the other?

*** NOTE:
I had to use /bin/bash (NOT /bin/sh) to initiate the script
/bin/sh just opened the terminal and closed it regardless if using x-terminal-emulator or lxterminal mentioned above.

tested with

#!/bin/sh
echo 'see me'
read

#!/bin/bash
echo 'see me'
read

Christophe C (batra3) wrote :

Lubuntu 12.04 : i confirm changing (pcmanfm / edit / pref / Advanc../)
x-terminal-emulator %s
   into
x-terminal-emulator -e %s

work. Perfect.

The solution is known. Why Lubuntu team doesn't fix that bug ?

Walter Lapchynski (wxl23) wrote :

Interestingly, the bleeding edge version of pcmanfm happily opens lxterminal with no problem and the preferences show NOTHING for terminal. This is to say it works fine out of the box. I'd call this fix committed.

$ apt-cache policy pcmanfm lxterminal
pcmanfm:
  Installed: 1.0.1+bzr801+201210081425~quantal1
  Candidate: 1.0.1+bzr801+201210081425~quantal1
  Version table:
 *** 1.0.1+bzr801+201210081425~quantal1 0
        500 http://ppa.launchpad.net/lubuntu-dev/lubuntu-daily/ubuntu/ quantal/main i386 Packages
        100 /var/lib/dpkg/status
     1.0.1-0ubuntu1 0
        500 http://us.archive.ubuntu.com/ubuntu/ quantal/universe i386 Packages
     1.0.1-0ubuntu1~ppa1 0
        500 http://ppa.launchpad.net/lubuntu-dev/staging/ubuntu/ quantal/main i386 Packages
lxterminal:
  Installed: 0.1.12~bzr580+201210071556~quantal1
  Candidate: 0.1.12~bzr580+201210071556~quantal1
  Version table:
 *** 0.1.12~bzr580+201210071556~quantal1 0
        500 http://ppa.launchpad.net/lubuntu-dev/lubuntu-daily/ubuntu/ quantal/main i386 Packages
        100 /var/lib/dpkg/status
     0.1.11-4ubuntu2 0
        500 http://us.archive.ubuntu.com/ubuntu/ quantal/universe i386 Packages

Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:
http://iso.qa.ubuntu.com/qatracker/reports/bugs/975152

tags: added: iso-testing
thedoctar (thedoctar) wrote :

I'd also like to say that Curtis's solution worked for me as well. I changed
x-terminal-emulator %s
to
lxterminal -e %s

Narcis Garcia (narcisgarcia) wrote :

Neither
x-terminal-emulator -e %s
nor
lxterminal -e %s
Works for me in Lubuntu 12.10

I've tested the parameters passed with this only string:
xmessage

And deduced that there is no % variable substitution. Then, seems enough with this:
x-terminal-emulator
(works for me)

Steve (steve-launchpad) wrote :

This is still a bug/problem for me in Lubuntu 13.04, pcmanfm 1.1.0.

I can confirm that changing

x-terminal-emulator %s

to

x-terminal-emulator -e %s

works as a work around or fix for me too.

Steve (steve-launchpad) wrote :

Correction:

I wrote a moment ago that x-terminal-emulator -e %s seems to work as a work around. That actually brings up a blank terminal window with nothing visible in it, that has to be manually closed.

lxterminal

seems to work for me. A terminal window opens, and closes when the job has finished.

I can confirm that this same problem is still present in Lubuntu 13.04 with all updates available as of today (Aug 08, 2013) installed.

The only way I can workaround it was to use just lxterminal under PCManFM -> Prefernces -> Advanced.

The previously suggested -e and/or %s results in just an open, inactive terminal.

netrick (netrick) wrote :

The simplest fix: change the command in pcmanfm to "lxterminal -e %s" and problem fixed. I can't believe that such an important and easy to fix issue remains unfixed for LTS release!

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

Duplicates of this bug

Other bug subscribers