1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-17 17:58:46 +00:00

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-&'.)
This commit is contained in:
Lars Ingebrigtsen 2022-07-02 14:21:00 +02:00
parent 8d68760dde
commit 5b112482fb

View File

@ -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