diff --git a/lisp/comint.el b/lisp/comint.el index c5589324a14..9d2c245247f 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -383,7 +383,8 @@ This variable is buffer-local." "\\(?:" (regexp-opt password-word-equivalents) "\\|Response\\)" "\\(?:\\(?:, try\\)? *again\\| (empty for no passphrase)\\| (again)\\)?" ;; "[[:alpha:]]" used to be "for", which fails to match non-English. - "\\(?: [[:alpha:]]+ .+\\)?[[:blank:]]*[::៖][[:space:]]*\\'" + "\\(?: [[:alpha:]]+ .+\\)?[[:blank:]]*" + "[" (apply #'string password-colon-equivalents) "][[:space:]]*\\'" ;; The ccrypt encryption dialog doesn't end with a colon, so ;; treat it specially. "\\|^Enter encryption key: (repeat) *\\'" diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index 46c3c2fa175..1b8f5ff8018 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -172,7 +172,10 @@ inserted. They return the string as it should be inserted." :type 'hook) (defcustom eshell-password-prompt-regexp - (format "\\(%s\\)[^::៖]*[::៖]\\s *\\'" (regexp-opt password-word-equivalents)) + (format "%s[^%s]*[%s]\\s *\\'" + (regexp-opt password-word-equivalents t) + (apply #'string password-colon-equivalents) + (apply #'string password-colon-equivalents)) "Regexp matching prompts for passwords in the inferior process. This is used by `eshell-watch-for-password-prompt'." :type 'regexp diff --git a/lisp/international/mule-conf.el b/lisp/international/mule-conf.el index 979e685e32a..30376b5bc19 100644 --- a/lisp/international/mule-conf.el +++ b/lisp/international/mule-conf.el @@ -1734,6 +1734,19 @@ included; callers should bind `case-fold-search' to t." :version "27.1" :group 'processes) +;; (describe-char-fold-equivalences ?:) +;; The last entry is taken from history. +(defcustom password-colon-equivalents + '(?\N{COLON} + ?\N{FULLWIDTH COLON} + ?\N{SMALL COLON} + ?\N{PRESENTATION FORM FOR VERTICAL COLON} + ?\N{KHMER SIGN CAMNUC PII KUUH}) + "List of characters equivalent to trailing colon in \"password\" prompts." + :type '(repeat character) + :version "30.1" + :group 'processes) + ;; The old code-pages library is obsoleted by coding systems based on ;; the charsets defined in this file but might be required by user ;; code. diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 01f1c38988c..420d6cadb9c 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el @@ -275,6 +275,19 @@ Add the extension of F, if existing." (autoload 'netrc-parse "netrc") (netrc-parse file)))) +;; User option `password-colon-equivalents' is new in Emacs 30.1. +(if (boundp 'password-colon-equivalents) + (defvaralias + 'tramp-compat-password-colon-equivalents + 'password-colon-equivalents) + (defvar tramp-compat-password-colon-equivalents + '(?\N{COLON} + ?\N{FULLWIDTH COLON} + ?\N{SMALL COLON} + ?\N{PRESENTATION FORM FOR VERTICAL COLON} + ?\N{KHMER SIGN CAMNUC PII KUUH}) + "List of characters equivalent to trailing colon in \"password\" prompts.")) + (dolist (elt (all-completions "tramp-compat-" obarray 'functionp)) (put (intern elt) 'tramp-suppress-trace t)) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 115048d59db..9fa9866aec8 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -641,10 +641,11 @@ This regexp must match both `tramp-initial-end-of-output' and :type 'regexp) (defcustom tramp-password-prompt-regexp - (rx - bol (* nonl) - (group (regexp (regexp-opt password-word-equivalents))) - (* nonl) (any "::៖") (? "\^@") (* blank)) + (rx-to-string + `(: bol (* nonl) + (group (| . ,password-word-equivalents)) + (* nonl) (any . ,tramp-compat-password-colon-equivalents) + (? "\^@") (* blank))) "Regexp matching password-like prompts. The regexp should match at end of buffer.