How to kill a process in a terminal inside emacs
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?
emacs
add a comment |
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?
emacs
1
Ctrl-G often works inside an emacs buffer.
– Faheem Mitha
Mar 14 '14 at 19:59
9
For me, Ctrl-C Ctrl-C sends a ^C to the terminal and I'm able to interrupt a running program.
– ALiX
Mar 14 '14 at 20:18
add a comment |
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?
emacs
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?
emacs
emacs
asked Mar 14 '14 at 19:18
user2290347
16617
16617
1
Ctrl-G often works inside an emacs buffer.
– Faheem Mitha
Mar 14 '14 at 19:59
9
For me, Ctrl-C Ctrl-C sends a ^C to the terminal and I'm able to interrupt a running program.
– ALiX
Mar 14 '14 at 20:18
add a comment |
1
Ctrl-G often works inside an emacs buffer.
– Faheem Mitha
Mar 14 '14 at 19:59
9
For me, Ctrl-C Ctrl-C sends a ^C to the terminal and I'm able to interrupt a running program.
– ALiX
Mar 14 '14 at 20:18
1
1
Ctrl-G often works inside an emacs buffer.
– Faheem Mitha
Mar 14 '14 at 19:59
Ctrl-G often works inside an emacs buffer.
– Faheem Mitha
Mar 14 '14 at 19:59
9
9
For me, Ctrl-C Ctrl-C sends a ^C to the terminal and I'm able to interrupt a running program.
– ALiX
Mar 14 '14 at 20:18
For me, Ctrl-C Ctrl-C sends a ^C to the terminal and I'm able to interrupt a running program.
– ALiX
Mar 14 '14 at 20:18
add a comment |
3 Answers
3
active
oldest
votes
As mentioned in the comments, by @ALiX using Ctrl+C+ Ctrl+C (2 times) worked.
add a comment |
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 6 at 9:40
@AAAfarmclub if you're usingansi-terminstead ofterm, then you should useC-x C-c(no, that won't exit your emacs)
– pizdelect
Dec 13 at 4:39
add a comment |
Use the key sequence C-c C-k.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f119737%2fhow-to-kill-a-process-in-a-terminal-inside-emacs%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
As mentioned in the comments, by @ALiX using Ctrl+C+ Ctrl+C (2 times) worked.
add a comment |
As mentioned in the comments, by @ALiX using Ctrl+C+ Ctrl+C (2 times) worked.
add a comment |
As mentioned in the comments, by @ALiX using Ctrl+C+ Ctrl+C (2 times) worked.
As mentioned in the comments, by @ALiX using Ctrl+C+ Ctrl+C (2 times) worked.
edited Apr 13 '17 at 12:36
Community♦
1
1
answered Mar 16 '14 at 12:44
user2290347
16617
16617
add a comment |
add a comment |
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 6 at 9:40
@AAAfarmclub if you're usingansi-terminstead ofterm, then you should useC-x C-c(no, that won't exit your emacs)
– pizdelect
Dec 13 at 4:39
add a comment |
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 6 at 9:40
@AAAfarmclub if you're usingansi-terminstead ofterm, then you should useC-x C-c(no, that won't exit your emacs)
– pizdelect
Dec 13 at 4:39
add a comment |
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
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
edited Dec 13 at 3:32
answered Apr 20 '14 at 7:09
Yongqiang Zhou
3925
3925
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 6 at 9:40
@AAAfarmclub if you're usingansi-terminstead ofterm, then you should useC-x C-c(no, that won't exit your emacs)
– pizdelect
Dec 13 at 4:39
add a comment |
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 6 at 9:40
@AAAfarmclub if you're usingansi-terminstead ofterm, then you should useC-x C-c(no, that won't exit your emacs)
– pizdelect
Dec 13 at 4:39
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 6 at 9:40
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 6 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)– pizdelect
Dec 13 at 4:39
@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)– pizdelect
Dec 13 at 4:39
add a comment |
Use the key sequence C-c C-k.
add a comment |
Use the key sequence C-c C-k.
add a comment |
Use the key sequence C-c C-k.
Use the key sequence C-c C-k.
edited Apr 27 at 7:58
user90255
1
1
answered Apr 27 at 3:40
Stanley Yang
1
1
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f119737%2fhow-to-kill-a-process-in-a-terminal-inside-emacs%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Ctrl-G often works inside an emacs buffer.
– Faheem Mitha
Mar 14 '14 at 19:59
9
For me, Ctrl-C Ctrl-C sends a ^C to the terminal and I'm able to interrupt a running program.
– ALiX
Mar 14 '14 at 20:18