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?

  • Please follow site norms. Do not sign off posts with "thanks" or "best." Do not sign off with your name or initial.
    – Dan
    Jul 2 '16 at 16:25

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)
  • perfect this works now
    – zeltak
    Jul 5 '16 at 4:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.