1

I have been using M-x compile for ages. Lately (our sysadmin has updated many things) it hangs after giving this message: WARNING: terminal is not fully functional - (press RETURN). Pressing return does nothing. I have tried changing the terminal to xterm, vt102, etc. with no change. I get a similar warning with M-x shell but I can proceed after hitting return a few times. Need to get this functionality back, thanks!

  • 2
    You'll want to find out what program is running that is giving you that message (probably git or less or something similar). It's normal for TERM to equal dumb in M-x shell, because the shell mode does not interpret any kind of escape codes, so the warning is expected. You could try M-x term instead; TERM will be eterm-color there, which supports most or all of the features that git or less wants. – db48x Jul 9 '20 at 15:10
  • @db4x Sorry if I wasn't clear. The command I am interested in running is M-x compile, which runs the command make -k. Perhaps M-x compile needs to invoke a different shell, but I have no idea how to do that. My knowledge of LISP is zero. – Gopal Patnaik Jul 9 '20 at 19:15
  • 1
    The comment by @db48x was most likely still pertinent. See if you can replicate this outside of Emacs in a terminal, by running the command env TERM=dumb make -k. It sounds like something being run by make is failing to cope with a dumb terminal. (Presumably that thing is one of the things that your sysadmin updated, and the developers have introduced a bug.) – phils Jul 9 '20 at 21:28
  • I just tried running the command @phils suggested. Make -k runs just fine. – Gopal Patnaik Jul 9 '20 at 23:13
  • 1
    Taking @db48x advice, I traced the problem to the module command that was being invoked in my .cshrc. I fixed the problem by setting the environment variable MODULES_PAGER to cat. Thanks all! – Gopal Patnaik Jul 14 '20 at 14:53
1

The problem arises because the M-x compile command uses the dumb terminal type and invokes .cshrc before running the command make -k. My .cshrc loads modules with the module command. The module command uses a pager which does not work properly with the dumb terminal type. The solution is to include the following in the .cshrc before the module command. The INSIDE_EMACS environment variable is set by the emacs shell. This also fixes M-x shell.

if (${?INSIDE_EMACS}) then
    setenv MODULES_PAGER cat
endif

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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