[Xquartz-dev] 2.3.2_rc4

Cameron Simpson cs at zip.com.au
Thu Dec 18 19:32:12 PST 2008


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.

> 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.

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

A lot of the discussion seems concerned with running the .xinitrc
(or the system equivalent). But that's wrong! We should be running the
.xsession or system default. The .xinitrc is run by startx, which is run
by the user _after_ their login, from a login shell or descendant. The
.xsession is run by GUI logins; because it runs _before_ the user's
ordinary login it has the task of sourcing the user's login environment.
Although it might seem like the .xinitrc is the go because X11 is
started from the apple desktop, post login, in fact X11's starting from
launchd, _outside_ the user's login process tree.

The system xsession still needs to solve the login env problem (and most
UNIX X11 desktops just punt on the issue by starting login shells in any
terminal). And if the user has a $HOME/.xsession you don't need to
bother because theyve undertaken the task themselves.

Cheers,
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

Peeve:  Going to our favorite breakfast place, only to find that they were
        hit by a car...AND WE MISSED IT.
                - Don Baldwin, <donb at netcom.com>


More information about the Xquartz-dev mailing list