15

When I code, I usually use multiple buffers in emacs. Some buffers with my code, and a buffer with a terminal emulator (M-x term), There I compile, execute interpreters, etc.

When I get an infinite loop in some computation, I cannot kill my process (As one could do with a normal terminal with Ctrl-C), since obviously the terminal embedded in emacs doesn't get the interrupt.

Is there a way to do this?

3 Answers3

23

As mentioned in the comments, by @ALiX using Ctrl+C+ Ctrl+C (2 times) worked.

2

If you run a process in eshell,you can use ctrl c ctrl c to kill the process, otherwise you can kill the buffer using ctrl x k

  • Using GNU Emacs 25.2.2 in Terminator. Ctrl-C+Ctrl-C didn't work, but Ctrl-x k (which calls kill-buffer) did. But, you lose the buffer... – AAAfarmclub Dec 06 '18 at 09:40
  • @AAAfarmclub if you're using ansi-term instead of term, then you should use C-x C-c (no, that won't exit your emacs) –  Dec 13 '18 at 04:39
-1

Use the key sequence C-c C-k.