Why do you want to set TERM in Emacs' shell? GNU Emacs is clever enough
to set it itself (to dumb). My previous hint with checking whether TERM
exists is valuable: only if not set source that group-wide .cshrc file!
The missing pieces from this file can be put into .emacs_csh to
initialise Emacs *shell* buffer.
.cshrc will be executed
before .emacs_csh. Where should I put the line 'if term is not set
source the group-wide cshrc' ? TERM is also being set in that common
cshrc file. The goal is: it should not be set only for emacs
shell.
I found
that emacs shell sets an environment variable EMACS to 't'. So only if
that is set, I can set TERM env in common cshrc file. So this is
working now. But this warning message is still there.
Warning: no access to tty (Bad file descriptor).
Thus no job control in this shell.
Although almost everything is fine, there are some problems because it
does'nt have a tty. For example, ftp is not working. I can't see
anything on the screen although ftp commands are working, because there
is no tty.
You should be a bit more specific in which OS this happens. And check
GNU Emacs' eshell too! This one is more kind of a terminal emulation.
*shell* is just a buffer in which a UNIX shell interpreter runs which
does not need much code from a shell rc file.
This is happening only in
linux OS as I mentioned in my first mail. On Solaris it is ok.
Our scenario is like this. We have common cshrc and aliasrc files which
are source controlled. These files, which set up our environment, must
be sourced by every member in a large team. Recently we upgraded emacs
and since then we are having this problem. I tried eshell too. But
eshell does'nt take .cshrc. Sourcing the file explicitly if causing
some errors as eshell is unable to understand some shell programming
constructs like 'foreach'. As cshrc is failing to load completely, our
environment is not being set in eshell.
Trying to get emacs working
and allocate appropriate tty seems to be the best way for me. As I
said, emacs-21.4 is able to allocate it sometimes. May be the code
which does tty allocation needs a fix.
Thanks,
Sunil