Bug#980069: Better documentation of x-terminal-emulator
On Wed, 13 Jan 2021 at 22:49:27 +0000, Bastien Roucariès wrote:
> gnome-terminal -e sleep 60
The upstream-provided gnome-terminal executable does not claim to be an
implementation of the x-terminal-emulator alternative. It has its own
command-line interface, which uses GNU-style long-option parsing (unlike
xterm). If we patched it to provide the x-terminal-emulator interface,
that modification would make it incompatible with upstream gnome-terminal,
and with other packages that know how the gnome-terminal interface works.
The Debian-specific script /usr/bin/gnome-terminal.wrapper is what gets
registered as an implementation of x-terminal-emulator if you have the
gnome-terminal package installed. Its command-line interface is almost
a subset of xterm's (it does additionally support --help, which xterm
does not).
If you want gnome-terminal behaviour, run gnome-terminal and pass
gnome-terminal arguments to it; if you want generic x-terminal-emulator
behaviour, run x-terminal-emulator and pass x-terminal-emulator
arguments to it. They are not the same, and programs can only rely on
x-terminal-emulator behaviour if what they run is the x-terminal-emulator
alternative. If they run a specific terminal directly, then they'll get
that specific terminal's behaviour, whatever that might be.
> Moreover some packages noticed that x-terminal-emulator does not wait by
> default
I'm not sure whether waiting for the executed command to exit is
actually part of the specification for x-terminal-emulator, but
/usr/bin/gnome-terminal.wrapper passes --wait to gnome-terminal, so that
it will behave like xterm in this respect.
Other implementations might not.
> I plan to create a sensible-x-terminal-emulator and thus I need to document;
> * the -e behavior, that should behave like xterm and do not need to use
> quotes
https://www.debian.org/doc/debian-policy/ch-customized-programs.html#packages-providing-a-terminal-emulator
describes what you can rely on from an implementation of the
x-terminal-emulator alternative. Anything not written there cannot be
relied on.
Policy promises that "x-terminal-emulator -e sleep 60" does what you think
it does.
Policy does not say anything either way on what
"x-terminal-emulator -e 'sleep 60'" will do. It happens to work with xterm
and with /usr/bin/gnome-terminal.wrapper, but that is not guaranteed.
smcv
Reply to: