2

so i have this function i found on the interent

   (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)

it works great by disabling confirmation when you close a terminal. it works on multi-term, ansi-term, ehsell but for some bizzaro reason not on shell. any one knows why?

Dan
  • 32,980
  • 7
  • 102
  • 169
zeltak
  • 1,725
  • 12
  • 28
  • Please follow site norms. Do not sign off posts with "thanks" or "best." Do not sign off with your name or initial. – Dan Jul 02 '16 at 16:25

1 Answers1

2

term-exec-hook is not called by shell-mode. It uses a different approach for running a shell, via comint rather than term-exec. So you need to add your function to the shell-mode-hook to get it applied to shell-mode.

(add-hook 'shell-mode-hook 'set-no-process-query-on-exit)
Tyler
  • 22,234
  • 1
  • 54
  • 94