Subject: Re: bug#79424: 30.2; shell-mode doesn't hide password

From: André A. Gomes <[email-masked]>
Date: Thu, 11 Sep 2025 14:04:32 +0100

André A. Gomes <[email-masked]> writes:

> This helped me understand the problem.  I'll send a patch soon,
> thanks.

Hi Michael,

Please find the patch attached.  Feel free to make any necessary
changes, thank you.

-- 
André A. Gomes
"You cannot even find the ruins..."
>From 4ea23e274c41f034e6b1a73196b3e10637ae19c1 Mon Sep 17 00:00:00 2001
From: "Andre A. Gomes" <[email-masked]>
Date: Thu, 11 Sep 2025 13:37:45 +0100
Subject: [PATCH] Make comint understand SSH proxy password phrases.

* lisp/comint.el (comint-password-prompt-regexp):
* test/lisp/comint-tests.el (comint-testsuite-password-strings): Add SSH
proxy password phrase (bug#79424).
---
 lisp/comint.el            | 4 +++-
 test/lisp/comint-tests.el | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/comint.el b/lisp/comint.el
index bbb9820c16a..6e0015af66f 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -425,7 +425,9 @@ comint-password-prompt-regexp
    ;; Default openssh format: "user@host's password:".
    "\\|^[^@ \t\n]+@[^@ \t\n]+'s password: *\\'"
    ;; openssh-8.6p1 format: "(user@host) Password:".
-   "\\|^([^)@ \t\n]+@[^)@ \t\n]+) Password: *\\'")
+   "\\|^([^)@ \t\n]+@[^)@ \t\n]+) Password: *\\'"
+   ;; "(user@host) Password for user@host:"
+   "\\|^([^)@ \t\n]+@[^)@ \t\n]+) Password for [^)@ \t\n]+@[^)@ \t\n]+: *\\'")
   "Regexp matching prompts for passwords in the inferior process.
 This is used by `comint-watch-for-password-prompt'."
   :version "31.1"
diff --git a/test/lisp/comint-tests.el b/test/lisp/comint-tests.el
index 6b6cc7256ec..d981aad7198 100644
--- a/test/lisp/comint-tests.el
+++ b/test/lisp/comint-tests.el
@@ -44,6 +44,7 @@ comint-testsuite-password-strings
     "Password (again):"
     "Enter password:"
     "(user@host) Password: " ; openssh-8.6p1
+    "(user@host) Password for user@host:" ; (Bug#79424)
     "Current password:"    ; "passwd" (to change password) in Debian.
     "Enter encryption key: " ; ccrypt
     "Enter decryption key: " ; ccrypt
-- 
2.48.1