terminator does not honor x-terminal-emulator -e option

Bug #366644 reported by Michael Fearon on 2009-04-25
24
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNOME Terminal
Won't Fix
Medium
Terminator
High
Tychodickerson
terminator (Ubuntu)
Wishlist
Tychodickerson

Bug Description

terminator does not honour the -e option as xterm does. It claims it is an alternative for x-terminal-emulator so it must honor it as the option -x in terminator.

----- Original report -----
Binary package hint: winff

NB. I haven't been able to recreate this bug so I'm not sure what caused it. However I am reporting it and a fix as a record of its exsistance.

Hope that's cool :/

I installed winff and got the error;

  x-terminal-emulator: error: Expected zero additional arguments, found 1

A little investigation revealed that /etc/alternatives/x-terminal-emulator was symlinked to /usr/bin/terminator which I had installed previously.

To solve the bug I created the correct symlink, /usr/bin/gnome-terminal.wrapper.

Winff now works as it should.

Related branches

A little more info I probably should have included:

DISTRIB_DESCRIPTION="Ubuntu 9.04"

I have had jaunty installed since the beta release came out. Terminator was installed during this period. Winff was installed on the day of the final release.

summary: - terminator creates a symbolic link that affects winff
+ a symbolic link to terminator affects winff
Paul Gevers (paul-climbing) wrote :

As far as I can see at the moment terminator does not use the proper syntax for it to declare to be an alternative for x-terminal-emulator [1]

Programs that depend on the -e option appear to be broken when terminator is the program linked in /etc/alternatives/x-terminal-emulator.

Please don't specify to be an alternative if this is not the case. And please correct me if I am wrong.

[1] http://www.debian.org/doc/debian-policy/ch-customized-programs.html#s11.8.3

affects: winff (Ubuntu) → terminator (Ubuntu)
description: updated
summary: - a symbolic link to terminator affects winff
+ terminator does not honor x-terminal-emulator -e option
Nicolas Valcarcel (nvalcarcel) wrote :

from terminator man page:
       -e, --command=COMMAND
              Runs the specified command instead of your default shell or pro‐
              file specified command

Paul Gevers (paul-climbing) wrote :

From the terminator man page:

   -x, --execute=COMMAND [ARGS]
        Runs the rest of the command line instead of your default shell
        or profile specified command.

This is the option that has the desired effect, as far as I understand it, according to the policy.
---- Policy ----
Support the command-line option -e command, which creates a new terminal window[78] and runs the specified command, interpreting the entirety of the rest of the command line as a command to pass straight to exec, in the manner that xterm does.

Paul

Chris Jones (cmsj) wrote :

The policy would suggest that GNOME Terminal is not suitable either, since its -x is xterm's -e, and it doesn't support -T.
We follow GNOME Terminal behaviour in this regard, our -x is xterm's -e and we do not support -T.

I suppose that means that on the face of it, we should not install the x-terminal-emulator alternative.
Instead I wonder if the Debian policy should be updated, since x-terminal-emulator will presumably point to GNOME Terminal on the vast majority of installs.

> The policy would suggest that GNOME Terminal is not suitable either,
> since its -x is xterm's -e, and it doesn't support -T.

I think this is correct. I will look at the gnome terminal and file a
bug there when appropriate.

> I suppose that means that on the face of it, we should not install
> the x-terminal-emulator alternative.

For the time being? See below.

> Instead I wonder if the Debian policy should be updated, since
> x-terminal-emulator will presumably point to GNOME Terminal on the
> vast majority of installs.

Which is fine with me. It is just that I need to trust the
x-terminal-emulator behaves predictable for my package (winff). And in
that case I follow the policy.

Paul

This is a big mess. Here on gentoo,

terminator -x man fvwm

give me the correct result. But

terminator -x "man fvwm"

give me terminator with a blank console and "Impossible de démarrer le shell man fvwm" (Impossible to start the shell man fvwm). The message should be "Impossible de démarrer la commande man fvwm" (Impossible to start the command man fvwm).

With other terminals:

gnome-terminal -e man fvwm
give me nothing (same result than terminator -x man fvwm).

gnome-terminal -e "man fvwm"
is working fine (like terminator -x man fvwm).

xterm -e "man fvwm"
and
xterm -e man fvwm
are both working fine. I guess that this is the appropriate behavior.

aterm -e man fvwm
is working fine, but
aterm -e "man fvwm"
give me nothing.

All that imply that one that will make some code that depend on /etc/alternatives/x-terminal-emulator or whatever your wm is using ($DefaultTerminal here), must test which term is in use and adapt the output in consequence.

For terminator, I think that the best way would be to work like xterm, that is with both '-e command' and '-e "command".

But that is not a big deal for me, I already adapted my code by adding one more test and the use of the -x option instead of -e for terminator.

Thank you for the good work with terminator.

Sorry,

gnome-terminal -e man fvwm
give me nothing (same result than terminator -x man fvwm).

is in fact

give me nothing (same result than terminator -e man fvwm).

Chris Jones (cmsj) wrote :

http://mail.gnome.org/archives/gnome-announce-list/1999-June/msg00022.html explains why GNOME Terminal has the options it currently has.

I would be particularly interested in any tests which show Terminator behaving differently to GNOME Terminal, also I suspect that changing either Debian policy or GNOME Terminal behaviour will be hard.

We do have the mild advantage that we are not GNOME Terminal, and could take the opportunity to behave differently (I am much less scared about breaking our behaviour than they are!)

Changed in gnome-terminal:
status: Unknown → Won't Fix
Chris Jones (cmsj) on 2009-06-29
Changed in terminator:
status: New → Confirmed
Changed in terminator (Ubuntu):
status: New → Confirmed
Chris Jones (cmsj) on 2009-12-01
Changed in terminator:
importance: Undecided → Wishlist
Changed in terminator (Ubuntu):
importance: Undecided → Wishlist
Changed in terminator:
milestone: none → 1.0-beta
Changed in gnome-terminal:
importance: Unknown → Medium

You never noticed that gnome-terminal has a wrapper in debian that correctly handles the -e option (when used as x-terminal-emulator)? That what other alternatives must do as well.

Chris Jones (cmsj) wrote :

Ulr: It doesn't look like that wrapper is in current Ubuntu releases - is it still in Debian?

Changed in terminator:
status: Confirmed → Incomplete

With 0.96 on gentoo, this is worst than ever:

terminator -x man bash
terminator -x "man bash"
terminator -e "man bash"

give me a new terminator window but without the man page, and

terminator -e man bash

give me

terminator: error: Additional unexpected arguments found: ['bash']

and no new terminator window.

We could do the following: if terminator is invoked as x-terminal-emulator, then it follows the policy. Else it behaves like gnome-terminal.

Chris Jones (cmsj) on 2013-01-30
Changed in terminator:
status: Incomplete → Confirmed
importance: Wishlist → High

Andrea, that's a good idea. Another possibility would be a preference setting. Both solutions are not exclusive.

If no pref is defined then follow the policy, or not, depending on how it is launched.
If the pref is defined, use the prefered policy in both cases.

If only one of those solutions is implemented, I would prefer a preference setting, because with the huge number of toolkits and wm/desktops lying around, who really knows what can append in any case....

I proposed that behavior for two reasons:

1. if one invokes x-terminal-emulator, he expects that it behaves like any x-terminal-emulator; and
2. this is a common behavior. Examples include: adduser (which can be invoked as addgroup), bash (which can be invoked as sh) and zsh (which can be invoked as sh or ksh).

So I'm in favor of the invocation name+setting alternative, rather than just the setting.

For completeness, here is an another alternative: copy and adapt gnome-terminal.wrapper. This is a perl wrapper around gnome-terminal that is used for x-terminal-emulator. It is very short and adapting consists in changing just the last line.

Ok. Andrea, I think you are right.

Also, I just try

terminator -x man bash
and terminator -e "man bash"

and they are working fine again. (terminator 0.96 on gentoo

But
amd64)terminator -x "man fvwm"
is failing like before.

Last, I think the gnome-terminal.wrapper script must be debian specific, because I don't have it into my system. Or the gentoo devs missed it.

Argg typo

It was gentoo amd64 and

terminator -x "man fvwm"
is failing like before.

Neal Fultz (nfultz) wrote :

I just sent a merge request that fixes this. I implemented Andrea's suggestion because it was easiest.

Nice ! And thank you.

Changed in terminator:
status: Confirmed → Fix Committed

It is a new problem with it. According to xterm man page, xterm -e [command] [command options] sould works.
In practice, it work only with gnome-terminal:

gnome-terminal -e mc /home/dom

With

terminator -e mc /home/dom

it fail. I must use quoting:

terminator -e "mc /home/dom"

which can be complicated if some command option already use quoting.

This is the same issue with xfce4-terminal and the Debien x-terminal-emulator, that on both gentoo and Debian sid.

What do we do? Do you re-open that bug or I must fill a new one?

the issue with x-terminal-emulator is because it is set to terminator.

/usr/bin/terminator -e mc /home/dom
Usage: terminator [options]

terminator: error: Additional unexpected arguments found: ['/home/dom']

Neal Fultz (nfultz) wrote :

My patch fixed terminator when it is symlinked and run as "x-terminal-emulator". It doesn't change any behavior if you continue to run it as "terminator".

Sorry for the noise, maybe it is specific to Debian. I get the same error on Debian with x-terminal-emulator as when calling terminator directly. I will report it to Debian.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package terminator - 0.97-3

---------------
terminator (0.97-3) unstable; urgency=medium

  * Add patch to fix -e parameter to work as
    x-terminal-emulator. (Closes: #734655 LP: #366644)
    + Thanks to Neal Fultz for it.
  * Add patch to fix splits not being central
    with multiple tabs. (Closes: #752658)
    + Thanks to Justin Ossevoort for it.
  * Update Homepage in d/control. (Closes: #740056)
    + Thanks to Richard Hartmann for it.
  * Bump Standards-Version to 3.9.5 (no changes).
  * Extend debian copyright holder years.

 -- Julián Moreno Patiño <email address hidden> Tue, 01 Jul 2014 15:06:08 -0500

Changed in terminator (Ubuntu):
status: Confirmed → Fix Released
Changed in terminator:
assignee: nobody → Tychodickerson (tychodickerson)
Changed in terminator:
assignee: Tychodickerson (tychodickerson) → nobody
assignee: nobody → Tychodickerson (tychodickerson)
Changed in terminator:
status: Fix Committed → In Progress
Changed in terminator:
status: In Progress → Invalid
Changed in terminator (Ubuntu):
assignee: nobody → Tychodickerson (tychodickerson)
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

Remote bug watches

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