Taking upstream at request of Gentoo devs.
According to the man page, startx is supposed to take the same command-line
syntax as xinit, and provide some extra services like setting up authorization
and such like. However, xinit handles single-quoted command line args with
embedded spaces correctly, but startx does not.
The script assumes that each individual command-line parameter has no embedded
spaces, with constructs like:
Thus, any special quoting or grouping on the startx command line won't get
propagated to xinit correctly.
I discovered this problem while trying to do some testing for another bug.
Boiled down, this command works:
xinit /bin/sh -vxc 'xsetroot -solid orange; sleep 5' -- :1
but this command, which per the docs should work, doesn't:
startx /bin/sh -vxc 'xsetroot -solid orange; sleep 5' -- :1
The former starts the server, sets the background color and waits for 5 seconds,
like it should. The latter starts the server and bails immediately since
xsetroot runs with no args and sleep isn't run at all.
I used a little sed command that I hope is adequate to quote for whatever shells
you intend to support as /bin/sh. Will upload patch.
Created attachment 1960 [details] [review]
patch to startx
Sorry about the phenomenal bug spam, guys. Adding xorg-team@ to the QA contact so bugs don't get lost in future.
Confirming the patch is still necessary and helpful on Gentoo linux with x11-apps/xinit-1.0.8-r3.
Mass closure: This bug has been untouched for more than six years, and is not
obviously still valid. Please reopen this bug or file a new report if you continue to experience issues with current releases.