From: Lars Ingebrigtsen Date: Sat, 2 Jul 2022 12:21:00 +0000 (+0200) Subject: Make comint-watch-for-password-prompt more resilient X-Git-Tag: emacs-29.0.90~1447^2~1274 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5b112482fbdb0351487a7af592ae901e20ec45c1;p=emacs.git Make comint-watch-for-password-prompt more resilient * lisp/comint.el (comint-watch-for-password-prompt): Don't try to send commands to the process after it's exited (bug#56336). (This commonly happens when invoked via `M-&'.) --- diff --git a/lisp/comint.el b/lisp/comint.el index 3da61fb992f..92262eab321 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -2515,8 +2515,9 @@ This function could be in the list `comint-output-filter-functions'." (1+ comint--prompt-recursion-depth))) (if (> comint--prompt-recursion-depth 10) (message "Password prompt recursion too deep") - (comint-send-invisible - (string-trim string "[ \n\r\t\v\f\b\a]+" "\n+")))))) + (when (get-buffer-process (current-buffer)) + (comint-send-invisible + (string-trim string "[ \n\r\t\v\f\b\a]+" "\n+"))))))) (current-buffer)))) ;; Low-level process communication