Fix password prompt in comint (don't merge)
authorMichael Albinus <michael.albinus@gmx.de>
Mon, 2 Dec 2024 18:21:54 +0000 (19:21 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Mon, 2 Dec 2024 18:21:54 +0000 (19:21 +0100)
* lisp/comint.el (comint-watch-for-password-prompt): Use whole
string for setting the prompt.  (Bug#74626)

lisp/comint.el

index 8860b3edb118d71329c5bdf9e7712ca4d12bc174..d52090911b95bd18804923c002b645a4e10f8ce5 100644 (file)
@@ -2573,8 +2573,7 @@ This function could be in the list `comint-output-filter-functions'."
     (when (let ((case-fold-search t))
             (string-match comint-password-prompt-regexp
                           (string-replace "\r" "" string)))
-      (setq prompt (string-trim (match-string 0 string)
-                                "[ \n\r\t\v\f\b\a]+" "\n+"))
+      (setq prompt (string-trim string "[ \n\r\t\v\f\b\a]+" "\n+"))
       ;; Use `run-at-time' in order not to pause execution of the
       ;; process filter with a minibuffer
       (run-at-time