nha
nha

Reputation: 18005

emacs kill process from list

When using M-x list-processes I get a list of processes.

Is there a way to kill them interactively ? For instance by selecting one in the list, then pressing q or something similar ?

In case it matters, I am using emacs 24.5.1 on osx with emacs prelude.

Note : it is different from this question I want to do it interactively, not from the mini-buffer (as understood by @legoscia already).

Upvotes: 1

Views: 660

Answers (1)

legoscia
legoscia

Reputation: 41648

In Emacs 25, you can do what you'd expect: in the process list, hit d to "delete" the process under point.


For earlier Emacs versions, I've been using this little function that works using the minibuffer, not the process list:

(defun delete-process-i(p)
  (interactive `(,(completing-read"Kill proc: "(mapcar 'process-name(process-list))()t)))
  (delete-process p))

After defining it, you can type M-x delete-process-i, and type the name of the process you want to kill, with tab completion.

(I originally wrote it to fit in 140 characters; thus the non-standard layout.)

Upvotes: 3

Related Questions