How to kill an internal process in Emacs? For example I run M-x shell.
I can check running processes with M-x list-processes but how can I kill a process from this list?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no default key binding for this; however see pjammer’s answer —
list-processes+includes (among other things) a kill binding on C-k — and also Joao Tavora’s answer — which provides just a kill binding (for the same key).event_jr points out in the comments that you can use M-:
(kill-process)RET to kill the current buffer’s process.More generally: You can use M-:
(kill-process PROCESS)RET, wherePROCESS“may be a process, a buffer, or the name of a process or buffer”, with those names being as they appear in the output oflist-processes. Process names take precedence over buffer names, should you happen to have a conflict; so it’s probably best to be in the habit of supplying the process name.Alternatively, Emacs 23+ has a general system process manager (
M-x proced) which is more akin to runningtop, and which does have a default binding for sending (arbitrary) signals (k). Of course it may be far less obvious in that listing which process you’re interested in.Edit: Better late than never 🙂 The following enables M-x
kill-processRET to be used (tested in Emacs 26.1):