>       So there is no solution to the original problem yet, as removing
> the line which sets TERM env cannot be a permanent solution.

But moving it to your .login file where it belongs is a solution.

   Kevin, as you suggested I tried moving 'setenv TERM vt100' to .login file. But .login file is read only once. And everytime we open a new shell using xterm it is not getting the TERM variable.
    Also we have all the settings in a common cshrc file which we 'source' from our ~/.cshrc. And setting TERM is done in that common file. Making changes to that file will not be a good solution to get emacs shell working as it will have wider implications. Also I feel, fiddling around with TERM variable is just a workaround. The problem of tty is still there. I still get warning message when I enter shell in emacs with 'setenv TERM ..' commented out.
    Since it is working in emacs-20.7, there is some change done in emacs-21.4. If that is identified then may be we can find a solution.

Sunil