I'm using tcsh
, and for a specific project every member of my team connects to a server with the same user. (This is something we cannot change).
The situation arises because I want to have some custom environment variables and aliases, and to do so I have my own .tcshrc file (namely .tcshrc_cust
) which I load as the first action when connecting to that machine:
source .tcshrc_cust
and even though this works pretty well, I'm experiencing a problem when using vim
: if I get to the shell from inside vim (with :sh
) I fall into a normal shell, without my custom env. vars. and aliases.
Is there a solution for this, besides using a different user in that machine?
SOLUTION (given by @Shawn):
I prefixed my key into .ssh/authorized_keys
with:
command="setenv subuser noz; tcsh"
and wrote at the end of .tcshrc
file these lines:
if ($?subuser) then
source .tcshrc_$subuser;
endif
And everything works fine now.