Variable: comint-password-prompt-regexp

comint-password-prompt-regexp is a customizable variable defined in comint.el.gz.

Value

"\\(^ *\\|\\( SMB\\|B\\(?:ECOME\\|ad\\)\\|C\\(?:VS\\|urrent\\)\\|Enter\\(?: \\(?:Auth\\|\\(?:sam\\|th\\)e\\)\\)?\\|Kerberos\\|LDAP\\|New\\|Old\\|PEM\\|Re\\(?:peat\\|type\\)\\|S\\(?:SH\\|UDO\\)\\|UNIX\\|V\\(?:ault\\|erify\\)\\|\\[su\\(?:\\(?:: authenticate\\|do\\(?:: authenticate\\)?\\)]\\)\\|doas\\|enter\\(?: \\(?:auth\\|\\(?:sam\\|th\\)e\\)\\)?\\|login\\|new\\|old\\) +.*\\)\\(?:\\(?:adgangskode\\|contrase\\(?:\\(?:ny\\|ñ\\)a\\)\\|decryption key\\|encryption key\\|geslo\\|h\\(?:\\(?:asł\\|esl\\)o\\)\\|iphasiwedi\\|jelszó\\|l\\(?:ozinka\\|ösenord\\)\\|m\\(?:ot de passe\\|ật khẩu\\)\\|p\\(?:a\\(?:rola\\|s\\(?:ahitza\\|s\\(?: phrase\\|code\\|ord\\|phrase\\|wor[dt]\\)\\|vorto\\)\\)\\|in\\)\\|s\\(?:alasana\\|enha\\|laptažodis\\)\\|wachtwoord\\|лозинка\\|пароль\\|ססמה\\|كلمة السر\\|गुप्तशब्द\\|शब्दकूट\\|গুপ্তশব্দ\\|পাসওয়ার্ড\\|ਪਾਸਵਰਡ\\|પાસવર્ડ\\|ପ୍ରବେଶ ସଙ୍କେତ\\|கடவுச்சொல்\\|సంకేతపదము\\|ಗುಪ್ತಪದ\\|അടയാളവാക്ക്\\|රහස්පදය\\|ពាក្យសម្ងាត់\\|パスワード\\|密[码碼]\\|암호\\)\\|Response\\)\\(?:\\(?:, try\\)? *again\\| (empty for no passphrase)\\| (again)\\)?\\(?: [[:alpha:]]+ .+\\)?[[:blank:]]*[::﹕︓៖][[:space:]]*\\'\\|^Enter encryption key: (repeat) *\\'\\|^Vault password ([^@-][^@]*): \\'\\|^[^@     \n]+@[^@        \n]+'s password: *\\'\\|^([^)@  \n]+@[^)@       \n]+) Password\\(?: for [^)@    \n]+@[^)@       \n]+\\)?: *\\'"

Documentation

Regexp matching prompts for passwords in the inferior process.

This is used by comint-watch-for-password-prompt.

This variable was added, or its default value changed, in Emacs 31.1.

Source Code

;; Defined in /usr/src/emacs/lisp/comint.el.gz
;; AIX puts the name of the person being su'd to in front of the prompt.
;; kinit prints a prompt like `Password for devnull@GNU.ORG: '.
;; ksu prints a prompt like `Kerberos password for devnull/root@GNU.ORG: '.
;; ssh-add prints a prompt like `Enter passphrase: '.
;; plink prints a prompt like `Passphrase for key "root@GNU.ORG": '.
;; Ubuntu's sudo prompts like `[sudo] password for user:'
;; Some implementations of passwd use "Password (again)" as the 2nd prompt.
;; Something called "perforce" uses "Enter password:".
;; OpenVPN prints a prompt like: "Enter Auth Password:".
;; OpenBSD doas prints "doas (user@host) password:".
;; See ert test `comint-test-password-regexp'.
(defcustom comint-password-prompt-regexp
  ;; When extending this, please also add a corresponding test where
  ;; possible (see `comint-testsuite-password-strings').
  (concat
   "\\(^ *\\|"
   (regexp-opt
    '("Enter" "enter" "Enter same" "enter same" "Enter the" "enter the"
      "Current"
      ;; Ansible.  (Bug#78442)
      "Vault" "SSH" "BECOME"
      "Enter Auth" "enter auth" "Old" "old" "New" "new" "login"
      "Kerberos" "CVS" "UNIX" " SMB" "LDAP" "PEM" "SUDO"
      "[sudo]" "[sudo: authenticate]" "[su: authenticate]"
      "doas" "Repeat" "Bad" "Retype" "Verify")
    t)
   ;; Allow for user name to precede password equivalent (Bug#31075).
   " +.*\\)"
   "\\(?:" (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:]]*"
   "[" (apply #'string password-colon-equivalents) "][[:space:]]*\\'"
   ;; The ccrypt encryption dialog doesn't end with a colon, so
   ;; treat it specially.
   "\\|^Enter encryption key: (repeat) *\\'"
   ;; Ansible.  The vault-id syntax is a guess.  (Bug#78442)
   "\\|^Vault password ([^@-][^@]*): \\'"
   ;; Default openssh format: "user@host's password:".
   "\\|^[^@ \t\n]+@[^@ \t\n]+'s password: *\\'"
   ;; openssh-8.6p1 format: "(user@host) Password:".
   ;; "(user@host) Password for user@host:"  (Bug#79424)
   "\\|^([^)@ \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"
  :type 'regexp
  :group 'comint)