#563352 [konsole] Interprets -e in a way inconsistent with x-terminal-emulator policy

Package:
konsole
Source:
konsole
Description:
X terminal emulator
Submitter:
Filipus Klutiero
Date:
2011-11-10 06:36:04 UTC
Severity:
important
#563352#5
Date:
2010-01-02 07:07:55 UTC
From:
To:
As reported in upstream #170867, konsole's interpretation of the "-e"
argument is different from xterm's. This is a problem in Debian as an
xterm-compatible behavior is mandated by policy 11.8.3 "Packages
providing a terminal emulator":
Support the command-line option -e command, which creates a new terminal
window[77 <http://www.debian.org/doc/debian-policy/footnotes.html#f77>]
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.
Debian Release: squeeze/sid
990 testing ftp.ca.debian.org
500 unstable ftp.ca.debian.org
--- Package information. ---
Depends (Version) | Installed
================================-+-=============
kdebase-runtime (>= 4:4.3.0) | 4:4.3.2-1
kdelibs5 (>= 4:4.3.2) | 4:4.3.2-2
libc6 (>= 2.2) | 2.10.2-2
libqt4-dbus (>= 4:4.5.2) | 4:4.5.3-4
libqtcore4 (>= 4:4.5.2) | 4:4.5.3-4
libqtgui4 (>= 4:4.5.2) | 4:4.5.3-4
libstdc++6 (>= 4.2.1) | 4.4.2-3
libx11-6 | 2:1.3.2-1
libxrender1 | 1:0.9.5-1


Package's Recommends field is empty.

Package's Suggests field is empty.

#563352#16
Date:
2011-10-25 04:48:45 UTC
From:
To:
tags 563352 - wontfix
thanks

The upstream report was marked as "RESOLVED"... and WONTFIX. Upstream
documented the behavior, but understandably does not consider it as a
bug. I'm not sure if the upstream tag is justified.
So, we'll have to patch :-(

#563352#21
Date:
2011-11-03 12:29:42 UTC
From:
To:
Hi,

I also don't think that Konsole should be patched. Instead clarify in
the policy what a "command" actually is. Saying "everything that works
with xterm" is too broad (and too broken).

Let's look at the one from the KDE bug report:
     konsole -e "cd src && make"

This is not a command, it's a line to be interpreted e.g. by a shell.
That's not the same but often confused: "cd" is a command and "make" is
another but the above is not. The suggestion in the KDE bug report is
indeed the solution:
     konsole -e /bin/sh -c "cd src && make"

as that fits any definition of command (/bin/sh) and arguments (the
other arguments) and fully complies to policy.
How is konsole supposed to see that this is to be interpreted by
/bin/sh and not by python or perl? Just because xterm does something
funky and blindly assumes a standard shell? That contradicts policy
11.8.3 _directly_:
"[...]runs the specified command, interpreting the entirety of the rest
of the command line as a command to pass straight to exec[...]"

xterm obviously does NOT do this!
And policy is not everything. Having a consistent behaviour of konsole
on Debian and non-Debian system is far more important.

HS

BTW: the example from the KDE bug report is rather stupid, using "cd
src && konsole -e make" seems smarter, no? And that even works :-O

#563352#26
Date:
2011-11-10 06:33:54 UTC
From:
To:
Le 3 novembre 2011 08:29:42, Hendrik Sattler a écrit :

The term "command" is ambiguous and does not necessarily mean a command name. The above is a shell command in the POSIX sense.

Hum, good point. I reported this as #648271, thanks.

I agree it would be ideal to have compatibility with vanilla upstream.
One way I see to achieve that would be to introduce new options in konsole. For example, add an --execute-compat option that behaves like -e. Then, perhaps a new command, say konsole-xterm-compat, could be added as a wrapper around konsole which would map calls to konsole-xterm-compat -e to konsole --execute-compat.