Limit the amount of text we examine when looking for password prompts
Both Comint and Eshell do this, and it can significantly slow down
commands that write a lot of output (bug#71576).
* lisp/comint.el (comint-password-prompt-max-length): New variable...
(comint-watch-for-password-prompt): ... use it. Additionally, use the
matched result for the Emacs-based password prompt.
* lisp/eshell/esh-mode.el (eshell-password-prompt-max-length): New
variable...
(eshell-watch-for-password-prompt): ... use it.
* etc/NEWS: Announce this change.
(cherry picked from commit
1a55e957ae57ec32ae960eabdb170b5b427392d4)