.tcshrc not being executed when terminal opens

Joined
Sep 3, 2009
Messages
8
Reaction score
0
Points
1
With 10.7 I'm finding that my .tcshrc is not being executed when I open a terminal window. (I checked and indeed my shell is still set to tcsh.) Instead, every time I open a terminal window I have to source .tcshrc or my path isn't set correctly.
 
V

valiant66

Guest
With 10.7 I'm finding that my .tcshrc is not being executed when I open a terminal window. (I checked and indeed my shell is still set to tcsh.) Instead, every time I open a terminal window I have to source .tcshrc or my path isn't set correctly.

Is this a question? Because I would like it to be. So let me rephrase:

How do I get Lion Terminal to read my .tcshrc file when it opens a new window? I.e. restore the Terminal behaviour I had under Snow Leopard?

Thanks.
 
Joined
Dec 11, 2010
Messages
1,808
Reaction score
40
Points
48
Location
Chicago
Your Mac's Specs
late 2012 mini w/SSD
I guess you should use .profile instead of .tcshrc
HTH
 
V

valiant66

Guest
Grr. Fix it myself.

OK. I don't know what got screwed up over the various upgrades (the primary reason I use tcsh rather than any other shell is that it was the default in Mac OS X 10.2 when I started using Terminal, and I'm too lazy to change) but here's information for anyone else who ends up here.

This is the tcsh login files in load order and where they are located in the file system:

Code:
Login files in order:
Order	 File			When?			
1.	/etc/csh.cshrc		always	
1.	/etc/csh.login		login shell 
3.	~/.tcshrc
	or ~/.cshrc		always	
3.	~/.history
	or $histfile		login shell 
3.	~/.login		login shell 
3.	~/.cshdirs
	or $dirsfile		login shell 
The order of /etc/csh.login and /etc/csh.cshrc may be reversed. 
The order of ~/.login and ~/.tcshrc, ~/.cshrc and ~/.history may be reversed.

Logout files in order:
Order	File			When?
1.	~/.logout		logout shell	
2.	/etc/csh.logout		logout shell

It seems all the old example location files have been deprecated, as have files in /usr, /usr/etc /usr/share/examples and so on.

Notice the "may be reversed" language. That means items numbered 1 might load in one order one time or another the next. Items numbered 3 might load in various orders variously also.

I hope this helps somebody else figure out where to put their shell customizing code. I personally am leaving csh.cshrc and csh.login alone and putting my code into ~/.login. Bash has its own .bash_login file, so there's no conflict there. And I have deleted my .tcshrc files since they seem to be ignored, and I won't have to worry about which settings file loads first.

No doubt this will work just fine until Mountain Lion overwrites all the default files and I have to start from scratch again...

(Oh, and gsahli, I don't know what the ~/.profile file is for or when it loads. I'm ignoring it.)

Excelsior!
 

hiasb

New member
Joined
Sep 18, 2023
Messages
1
Reaction score
0
Points
1
I had the problem on macOS Montery and with tcsh which I had selected in the User & Groups setting by a right-click on my account and selecting advanced. In the preferences of terminal I left "default login shell" checked. My ~/.cshrc file was not sourced automatically at login. The ~/.login file was sourced as expected. Renaming .cshrc to .tcshrc solved the problem.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top