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: clientargs="$clientargs $1" 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. This is likely to get classified as an upstream bug, and I'll understand if you do, except that in the comments at the top of startx it says: # Site administrators are STRONGLY urged to write nicer versions. As the distro is the intermediary between said site administrators and X.org, it makes more sense for Gentoo to provide said nicer version than for each individual sysadmin. Avoiding the temptation to use shell arrays (which are in POSIX but which need bashisms to be actually useful), I used a little sed command that I hope is adequate to quote for whatever shells Gentoo supports as /bin/sh. Will upload patch.
Created attachment 51867 [details, diff] patch to startx
/me puts on his upstream hat no distro i know of customizes the startx script to any meaningful extent. also it doesn't make sense for gentoo to maintain this patch forever when xorg would be interested to have it. bugs.freedesktop.org would be the appropriate upstream place to report this. good catch!
I guess that means you want me to take this one upstream for you, too ;). Will do shortly.
Bug filed upstream: https://bugs.freedesktop.org/show_bug.cgi?id=2595
watching this one upstream.