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!

Stefan
  • 26,154
  • 3
  • 46
  • 84
  • 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 09 '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 09 '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 09 '20 at 21:28
  • I just tried running the command @phils suggested. Make -k runs just fine. – Gopal Patnaik Jul 09 '20 at 23:13
  • Yes, I meant that you should use `M-x shell` and `M-x term` as troubleshooting tools to let you clarify the problem. You need to find out what program was being run that had the problem, and under what circumstances it has the problem. Note also that `make` does not do exactly the same work every time you run it; you may need a clean slate every time you try to reproduce this problem, but that this in itself can help you figure out where the problem is. It's traditional for `make clean` to reset to a clean slate, but you may want to double check the Makefile in case it calls it something else. – db48x Jul 10 '20 at 04:28
  • 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
  • You should provide an answer to the question, so that when others have the same problem they'll have an explanation that they can use. – db48x Jul 15 '20 at 10:39

1 Answers1

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