Re: Starting order for xterm vs. terminal
Re: Starting order for xterm vs. terminal
- Subject: Re: Starting order for xterm vs. terminal
- From: Joe Davison <email@hidden>
- Date: Wed, 2 Jul 2003 07:42:46 -0500
On Wednesday, July 2, 2003, at 03:06 AM, Ralph Martin wrote:
On Wednesday, July 2, 2003, at 02:32 AM, Adrian Umpleby wrote:
Can someone give a clear explanation of exactly what files are read
and executed as
(1) Apple's terminal program opens a new window
(2) Apple's X11 xterm program opens a new window
Thanks for all the helpful suggestions. Unfortunately, none has fixed
my problem.
I still would like a clear idea of which files are read and in what
order.
There seems to be some combination of
~/.tcshrc
~/.login
~/.cshrc
~/.MacOSX/environment.plist
~/Library/init/tcsh/rc.mine
~/.xinitrc
/etc/csh.login
/etc/csh.cshrc
/etc/X11/xinit/xinitrc
and probably others.
The PATH is also inherited from other places too...
This is ugly...
There are several components to the answer, and I can only tell you
part of it.
First, you need to understand that there are several programs that are
involved, one starts, reads some files (creating an "environment" , and
then starts the next, which gets (some of) the environment from the
first one, and then reads some more files, changing the environment.
For instance, when you run X11.app and start an xterm window, you run
two programs -- x11.app -- it reads both the .MacOSX/environment.plist
and the xinitrc and/or ~/.xinitrc
The it calls xterm, which I suspect doesn't read any files, except it
looks up the "login shell" in your account information, which seems to
be /usr/bin/tcsh for you, and starts that program.
The details about what files tcsh reads on startup are found in the
tcsh manpage and/or book that explains how to use it. It will be some
combination of all those files that include "csh" somewhere in their
pathnames. Since I don't use tcsh (or csh) I can't answer that
question for you. Note that which ones it reads will depend on whether
xterm is invoked with the -ls flag -- it probably only reads the
"login" files if the -ls flag is there.
The answer for Terminal.app is actually the same as for xterm -- it
inherits some values from its environment, and then invokes (starts)
your shell (tcsh), which does most of the file reading.
Thus, there are actually only a few pieces of information you need, and
can combine:
1. X11.app and Terminal.app inherit the same environment (that is, you
start them both from the same environment). So, starting conditions
are the same for both those programs.
2. X11.app reads some files and establishes a different environment for
xterm to start in.
3. xterm does the same thing Terminal.app does -- they both start tcsh.
So, your best bet is to look through your tcsh documentation looking
for the description of the files it reads on startup -- it's almost
certainly in a single place -- and if you type "man tcsh" and page down
once or twice, you'll see a "startup and shutdown" heading where it
gives the answer. Note the "Non-login shells" paragraph -- it you put
"-ls" on the xterm command, it will be a login shell, without it, it's
a non-login shell,
There's probably also a section in the tcsh docs where it talks about
the environment and what gets inherited and what doesn't.
I'd suggest, if you're going to get into this kind of work, that you
find a book on tcsh (I believe O'Reilly has one) and consult that --
you'll really need to understand the environment issues in order to be
able to do much from the command line.
joe
_______________________________________________
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.