[Xquartz-dev] 2.3.2_rc4

Martin Costabel costabel at wanadoo.fr
Thu Dec 18 23:17:12 PST 2008


Cameron Simpson wrote:
> On 19Dec2008 00:37, Martin Costabel <costabel at wanadoo.fr> wrote:
>> I think the following works (does for me, anyway, but I haven\t tested  
>> it extensively):
>>
>> #!/bin/sh
>> /usr/bin/login -pqf $USER <<EOF
>>   $*
>> EOF
> 
> Please no. That completey mangles the command line if any of the
> app command line arguments have spaces.

Which app command line arguments are you talking about? I am targeting 
specifically the startup procedure of X11 on Mac OS X Leopard, where the 
command corresponding to $* in the above is typically something like

   /Applications/Utilities/X11.app/Contents/MacOS/X11.bin -psn_0_716975

Do you have another suggestion how to fix Jeremy's current approach to 
starting X11 on Leopard, so that it works for users who have tcsh as 
their login shell?

The current version in 2.3.2-rc4 is a regression for tcsh users, because 
it not only does not run a login shell in the first xterm it starts, but 
it does not transmit a login environment to the commands started from 
X11's "Applications" menu.

Actually, I don't know how these commands in the "Applications" menu are 
currently run. My test script that I used for probing this writes the 
output of `printenv` and of `ps xwwej` to some file in /tmp/. With rc4, 
it does not seem to be run at all, or the output redirection does no 
longer work; in any case, it no longer creates that file in /tmp.

>> I wonder how Terminal.app is doing this. After all, it manages to start  
>> a login shell for everybody.
> 
> Historically, if a shell is started with the first character of argv[0]
> supplied as a dash then it runs as a login shell. That's how the magic
> used to work; that way the caller doesn't need special per-shell
> knowledge.

How do you get that "-" into argv[0]? Are you suggesting that one should 
write a wrapper in C instead of a shell script?

> Are we not spending a lot of effort in the wrong place?

That may well be the case, but I don't see anyone spending any effort on 
rewriting once again the whole startup procedure for X11 on Leopard.

-- 
Martin






More information about the Xquartz-dev mailing list