When I open a file via tramp on a remote machine and then start a shell with M-x shell I get an infinite loop because of my .cshrc file.

I want to use a newer gcc version in CentOS so I have:

set X="`gcc -dumpversion`"
if ($x != "4.8.2") then
  scl enable devtoolset-2 tcsh

It seems that inside emacs the gcc -dumpversion always gives 4.4.7 and the scl enable is run an infinite number of times. (The scl enable starts a new shell.)

When I ssh into this machine it starts fine with gcc 4.8.2.

Do I have to use any settings to get the shell in emacs tramp to work?

  • The code is from my login script .cshrc
    – Helge
    Commented Mar 7, 2017 at 9:04

1 Answer 1


I'm not sure that your setup will work. You use csh, but Tramp supports only POSIX-like shells. Settings like $PATH, you might have in your .login or .cshrc, won't be applied.

Maybe you play with tramp-remote-path and alike, in order to get better results.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.