1

I have problem starting shell in Emacs. When I do "M-x shell", this error message come up in shell buffer:

no sessions

open terminal failed: terminal does not support clear

Process shell finished

So please help. My Emacs version is 25.2.2 on Ubuntu

  • Does this happen if you run emacs without your init file by starting it as emacs -Q? – zck May 25 '18 at 18:25
  • When I start Emacs from terminal with '-Q' or without it, Emacs shell works in both cases. But when I start Emacs from 'Application Menu', Emacs shell won't work. – ذوالفقار عبد الحليم May 26 '18 at 1:16
4

This is not a problem with Emacs, it is a problem with your shell's initialisation files or the shell itself.

M-x shell runs the shell in an environment where the TERM variable is set to dumb, which informs the shell and applications that the terminal does not support any terminal control escape sequences. Apparently something in your initialisation files expects to be able to clear the terminal, and the shell terminates if the terminal doesn't support being cleared.

If you really want a shell in Emacs with a full terminal emulator, M-x term will do that. However, I would recommend that you fix your shell initialisation so that it works on dumb terminals.

  • Thanks for your reply. But how to fix shell initialization? – ذوالفقار عبد الحليم May 26 '18 at 15:32
  • @ذوالفقارعبدالحليم Comment out all the code in your shell config files and check whether that allows M-x shell to work. If so, uncomment the code again in stages, and narrow down exactly which part(s) of the config cause the problem. Once you've done that, you can update your question with more specific details of the cause (and, if you figured out how to fix it, you could post an answer as well). – phils May 27 '18 at 12:11

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.