[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#648271: #648271 [debian-policy] 11.8.3 "Packages providing a terminal emulator" says xterm passes -e option straight to exec

>However, as pointed out by Hendrik Sattler in #563352, xterm does *not*
>simply pass its -e option straight to exec, at least nowadays. The
>following command exemplifies:
>> $ xterm -e 'echo TEST && sleep 3'

yes/no.  The original issue here appears to apply to the policy's use in
konsole and gnome-terminal.  But the indicated code slice implies that the
observations being made are on xterm's support for luit (absent in those
programs).  However, as the policy states, the preferred method is via exec.
Using a different scheme first would violate the policy.  It doesn't mention
the possibility of error recovery.

In xterm's main.c, there's a later fallback (if the other exec's fail) to use
an "sh -c command", which was added at the end of 2002:

Patch #172 - 2002/12/27 - XFree86
     * modify the -e option so that if it fails, xterm will check if only
       one  argument  follows,  e.g., it was quoted, and then retry using
       sh -c.

That is, if the exec calls fail, xterm retries using a different scheme.
The intent of that change is reflected in my checkin comment:

   minor juggling so 'xterm -e "vile foo"' will run without worrying about
   the extra quotes - after failing once, xterm passes it to the shell, so
   it becomes 'xterm -e sh -c "vile foo"'.

Responding to your remark: "nowadays" is coming up on nine years.
No problem - konsole and gnome-terminal have other differences from xterm which
are older than that.


Thomas E. Dickey <dickey@invisible-island.net>

Attachment: signature.asc
Description: Digital signature

Reply to: