.cshrc
.login
.twmrc
.xinitrc
.xssession
Answer
If your login shell is csh or tcsh:
Logging in via xdm (e.g., at a workstation or X terminal):
.xsession is run by a Bourne shell (always by a Bourne shell) and starts all applications. When this shell script exits, you are logged out. Therefore, all X applications started by this file should be run in the background (&) EXCEPT the last one. Typically the last application is a window manager (such as twm).
.cshrc is run by any csh that is started as a result of running xterm in .xsession
Note that .login is not run at all when logging in via this method.
Logging in directly to the console or via a terminal server:
.cshrc is run by the login shell .login is run by the login shell
The user may then type startx (or xinit) in which case the file .xinitrc is run by a Bourne shell. This script starts X applications. When it exits, the X session terminates and the user is returned to the login shell. Therefore, all X applications started by this file should be run in the background (&) EXCEPT the last one. Typically the last application is a window manager (such as twm).
TWM:
twm is a window manager---a process that decorates X windows, provides popup menus, and the ability to move, iconify, and resize windows. The file .twmrc is the configruation file for twm. twm is not started unless it appears in .xsession or .xinitrc (whichever is appropriate).
Notes:
. some users choose to put "startx" (or "xinit") in their .login, thus entering X immediately upon login.
. "startx" is preferred to "xinit".
. If tcsh cannot find .cshrc, then it tries to run .tcshrc.