From 14bbebcf1d217dcfc679fc95f195867cdf267f89 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 7 Nov 2021 21:34:41 +0100 Subject: [PATCH] Match password prompts from new OpenSSH * lisp/comint.el (comint-password-prompt-regexp): Add support for the openssh-8.6p1 "(user@host) Password:" format (bug#51666). --- lisp/comint.el | 6 ++++-- test/lisp/comint-tests.el | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/comint.el b/lisp/comint.el index c114bdf758a..adae971eff2 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -385,10 +385,12 @@ This variable is buffer-local." "\\(?: [[:alpha:]]+ .+\\)?[[:blank:]]*[::៖][[:space:]]*\\'" ;; The ccrypt encryption dialogue doesn't end with a colon, so ;; treat it specially. - "\\|^Enter encryption key: (repeat) *\\'") + "\\|^Enter encryption key: (repeat) *\\'" + ;; openssh-8.6p1 format: "(user@host) Password:". + "\\|^([^)@ \t\n]+@[^)@ \t\n]+) Password: *\\'") "Regexp matching prompts for passwords in the inferior process. This is used by `comint-watch-for-password-prompt'." - :version "28.1" + :version "29.1" :type 'regexp :group 'comint) diff --git a/test/lisp/comint-tests.el b/test/lisp/comint-tests.el index e1bac81a185..0bd5c1e9d15 100644 --- a/test/lisp/comint-tests.el +++ b/test/lisp/comint-tests.el @@ -43,6 +43,7 @@ "PIN for user:" ; Bug#35523 "Password (again):" "Enter password:" + "(user@host) Password: " ; openssh-8.6p1 "Current password:" ; "passwd" (to change password) in Debian. "Enter encryption key: " ; ccrypt "Enter decryption key: " ; ccrypt -- 2.39.5