- Package:
- debian-policy
- Source:
- debian-policy
- Submitter:
- "Bastien Roucariès"
- Date:
- 2021-01-23 08:09:11 UTC
- Severity:
- important
- Blocked By:
-
Bug Title 874019 1
Note that the '-e' argument to x-terminal-emulator works like '--' normal stable testing unstable over 5 years ago
control: block -1 by 874019 Hi, x-terminal-emulator documentation is incomplete. For instance the behavior of the -e option is different between xterm and gnome-terminal: try: gnome-terminal -e sleep 60 xterm -e sleep 60 gnome-terminal close immediately with a depression warning, where as xterm sleep 60. for gnome-terminal we should use the deprecated gnome-terminal -e 'sleep 60' or the newer variant gnome-terminal -- sleep 60 Moreover some packages noticed that x-terminal-emulator does not wait by default and so create wrapper to correct this misbehavior (see https:// sources.debian.org/src/links2/2.21-1/debian/x-terminal-emulator-which- properly-handles-dash-e/) 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. Moreover -e should be the last option. * that x-terminal-emulator should wait end of child process Thanks Bastien
Note that what policy documents is the minimal requirement for a package to provide the x-terminal-emulator alternative. Cheers,
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. 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. 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
Le jeudi 14 janvier 2021, 00:00:39 UTC Simon McVittie a écrit : - document that -e should be the last option - document that the list of argument after should not be quoted (and it is saner for a implentation point of view) - document that x-terminal-emulator should wait - -t documentation is clear - document that additional option may be accepted I believe also that package provinding x-terminal-emulator should Provides: x-terminal-emulator (=1.0). It will ease transition if we add incompatible changes to the spec, and that we should modify one wrapper in order to be spec compliant. Yes and it is a problem. I plan to improve sensible-editor. If you set sensible-editor in desktop and you set editor as nano it will try to open an terminal. Parent application will wait until closing. So wait is here needed Link2 have the same problem, terminal should wait. It is implemented by current application, so consensus is here but it should be documented. Moreover if you could not want to wait we could always run it is background subshell. I found the wording not clear. It should be improved here. When policy is clearer I plan to create a man page of x-terminal-emulator and I will put it in sensible-utils, so I need a really clear documentation. I really found that x-terminal-emulator manpages be a copy of gnome-terminal is a bug: - gnome-terminal is not x-terminal-emulator - at least it should redirect to gnome-terminal.wrapper manpage - better wlll be a manpage common to all x-terminal-emulator that document only the policy compliant options. Other options are implementation detail Yes I know, and BTW I found this behavior a least error prone, but it may be acceptable. Thanks Bastien