diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2022-07-02 14:21:00 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2022-07-02 14:21:00 +0200 |
commit | 5b112482fbdb0351487a7af592ae901e20ec45c1 (patch) | |
tree | 1e4471c137fd027b7598588f5ce87acbf4a7248c /lisp/comint.el | |
parent | 8d68760ddee3690b4312fdb5d85210cb21b4eb7d (diff) | |
download | emacs-5b112482fbdb0351487a7af592ae901e20ec45c1.tar.gz |
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-&'.)
Diffstat (limited to 'lisp/comint.el')
-rw-r--r-- | lisp/comint.el | 5 |
1 files changed, 3 insertions, 2 deletions
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 |