[Xquartz-dev] env variables and launchd problem

Jeremy Huddleston jeremyhu at apple.com
Wed Mar 23 17:53:02 PDT 2011


On Mar 23, 2011, at 14:22, Dave Ray wrote:

> robert delius royar wrote:
> 
>>> To reiterate, I am starting up X11 with only an xterm and no window 
>>> manager. I am typing 'env' in that xterm. This where I'm seeing ENV 
>>> being different from terminals opened normally. This is the only way I 
>>> can capture the difference in what env is being passed to X11 versus 
>>> other shells at the terminal.
>> 
>> What if you add the following to the X11 Applications menu:
>> Name: Environment
>> Command: /usr/bin/env > /tmp/xenv 
>> and select the command 'Environment' from the menu?
>> 
>> What do the contents show in /tmp/xenv? Wouldn't that give you the 
>> environment that the xserver uses (rather than any environment created 
>> for an xterm child process)?
> 
> I tried your suggestion. The contents of /tmp/xenv are the same as normal shells, they have my  user-modfied path that includes /usr/local/bin. Actually, any X11 terminal that is opened by the Applications menu of X11.app has the ENV from my config file.
> 
> The xterm that opened at the beginning of the session from .xinitrc.d/99-wm.sh still has the shorter path without /usr/local/bin and is not reading my config.

because the xterm in your xinitrc is a child process of xinit which is a child of startx which can be a child of either X11.app or launchd (depending on what $DISPLAY is and how you launched the server).  The xterms launched from the menu are children of X11.app itself (which gets its environment from your login shell).

> This is with copies of the same bash config file in three places: ~/.profile, ~/.bash_profile, and /etc/bashrc. I'm going to keep those copies in place until I get to the bottom of it.
> 
> Perhaps what I'm seeing is normal. Is it normal for my bash config not to be loaded at the xterm that is invoked from .xinitrc.d/99-wm.sh ? If so then perhaps the wm I'm testing is not reading its ENV properly. 

There's no such thing as "my bash config" ... you have multiple config files that are used differently depending on invocation.




More information about the Xquartz-dev mailing list