17

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?

2
  • 1
    Ctrl-G often works inside an emacs buffer. Commented Mar 14, 2014 at 19:59
  • 11
    For me, Ctrl-C Ctrl-C sends a ^C to the terminal and I'm able to interrupt a running program. Commented Mar 14, 2014 at 20:18

3 Answers 3

26

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

0
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

2
  • 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... Commented Dec 6, 2018 at 9: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) Commented Dec 13, 2018 at 4:39
-1

Use the key sequence C-c C-k.

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.