2

Whenever I kill an ansi-term buffer I have to confirm due to the fact of: "ansi-term has a running process; kill it ?", (even if nothing is running btw).

How could I have Emacs killing the term without requiring this confirmation regardless of active processes.

Thanks !

wizmer
  • 917
  • 1
  • 7
  • 9
  • 3
    Assuming you're running a shell in the terminal, the "running process" is the shell itself. If you exit your shell (typically C-d or exit) before killing the ansi-term buffer, it will not ask you this question. – phils Sep 30 '15 at 01:41

1 Answers1

5

Try something like this:

(defun set-no-process-query-on-exit ()
  (let ((proc (get-buffer-process (current-buffer))))
    (when (processp proc)
      (set-process-query-on-exit-flag proc nil))))

(add-hook 'term-exec-hook 'set-no-process-query-on-exit)
scbagley
  • 619
  • 3
  • 3