• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
(no subject)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(no subject)


  • Subject: (no subject)
  • From: Rene Tio <email@hidden>
  • Date: Fri, 7 Feb 2003 12:24:04 -0800

This subject has been covered before. Check the thread "dang .xinitrc" in the archives. I put ". $HOME/.profile" in my .xinitrc file for XDarwin, but that does not take care of the Applications menu in Apple X11. There have been suggestions to modify the X11.app startup script and also enabling the loginShell for XTerm resources, all of which work but have their caveats (for example, xterm -ls -e "some command" wouldn't work if "some command" relied on something in .bash_login or .profile or .bash_profile; I've never found out why.)

The issue is that if you are used to logging in to a Unix-style system, login takes care of it for you. However Apple does not use login, and .xinitrc covers the applications started in .xinitrc and quartz-wm, but apparently does not cover the menu bar Applications.

Here's a sample of the X11 processes on a NetBSD machine:

USER PID PPID PGID SESS JOBC STAT TT TIME COMMAND
tor 26834 1 26834 8af200 0 Is+ E0 0:00.10 -bash
tor 26856 26834 26834 8af200 0 I+ E0 0:00.01 xinit
tor 26860 26856 26860 8af200 1 I E0 0:00.01 sh /home/tor/.xinitrc
tor 26881 26860 26860 8af200 1 I E0 0:00.37 gnome-session


As you can see, all the X processes on this machine eventually trace their way back to the -bash process, which is a login shell. Thus all the child process inherit the environment. Linux machines behave in the same way.

In contrast, here is Apple's X11:

PID PPID COMMAND
173 1 /System/Library/CoreServices/WindowServer -daemon
540 173 /Applications/X11.app/Contents/MacOS/X11 -psn_0_1703937
541 540 /Applications/X11.app/Contents/MacOS/X11 --xquartz-be-xinit -noreset -nolisten tcp -psn_0_1703937
543 1 sh /Users/tor/.xinitrc
565 543 /usr/X11R6/bin/quartz-wm


Note that .xinitrc is started directly from the init process (PID 1) and does not trace it's ancestry back to a login shell. Additionally I am guessing the Menu bar Applications menu is started from one of either process 540 or 541, which again traces it's way back to init and not a login shell. Thus to adequately cover the bases for inheriting the environment, I suspect (I haven't tried this) one needs to both modify the X11.app start-up script as well as source .profile in .xinitrc.

R.


Date: Fri, 7 Feb 2003 09:11:46 -0800
To: email@hidden
From: Lawrence You <email@hidden>
Subject: Re: Bash login shells with X11 (executing .bash_profile,
  .bashrc)

At 10:29 AM +0100 2/7/03, kristian ragndahl wrote:
On Thu, 6 Feb 2003, Lawrence You wrote:

 Has anyone been able to get .bash_profile to be executed without
 having to specify "xterm --login"? When I start up an xterm from the
 X11 Beta, .bash_profile doesn't get run at any time.

I put this in my ~/.Xdefaults; XTerm*.LoginShell: True

--
kristian ragndahl


Thanks for this and the other responses. I use .Xdefaults for other
programs but it didn't occur to me to try to set the resource for
xterm. I can't remember ever having to set xterm for login before.
That works.

I was going to say that this behavior seems like a bug, i.e. that at
some point, I'd assume that you would have "logged in" and the script
would be executed. Since the login on Mac OS X is not shell-based,
that assumption is wrong (and for the vast majority of Mac OS X
users, a behavior they probably don't want or need). I think it would
be nice for the X11 application to assume that it is taking care of
the "login" step, albeit without any kind of authentication.

Anyway, for the record, I did a quick survey of Unix or Unix-like
environments asking the question "Does it execute .bash_profile at
'login'?":

Cygwin terminal:  Yes

Cygwin/XFree86(double-clicking startxwin.bat icon)/xterm:  No

Cygwin/XFree86(manually executing startx)/xterm:  Yes (inherits
current env variables)

xdm/KTerm or xdm/xterm (Red Hat 7.1/x86): Yes

Unix login (Linux, BSD, whatever): Yes

XDarwin (w/or w/o OroborOSX): Yes

X11 for Mac OS X Beta: No


It's subtle, I think I'm being pedantic, but I would like that last line to say "Yes."

-Lawrence


--__--__--

_______________________________________________
x11-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/x11-users
X11 for Mac OS X FAQ: http://developer.apple.com/qa/qa2001/qa1232.html
Report issues, request features, feedback: http://developer.apple.com/bugreporter
Do not post admin requests to the list. They will be ignored.


End of x11-users Digest
_______________________________________________
x11-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/x11-users
X11 for Mac OS X FAQ: http://developer.apple.com/qa/qa2001/qa1232.html
Report issues, request features, feedback: http://developer.apple.com/bugreporter
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: (no subject)
      • From: Randy Ford <email@hidden>
    • Re: (no subject)
      • From: email@hidden (Randal L. Schwartz)
  • Prev by Date: X11 Application development advice needed
  • Next by Date: Re: Adding apps to the application menu?
  • Previous by thread: Re: X11 Application development advice needed
  • Next by thread: Re: (no subject)
  • Index(es):
    • Date
    • Thread