On Thu, Dec 06, 2007 at 05:35:00PM +0100, Sven Joachim wrote:
>> As a result of http://bugs.debian.org/343268 [...]  "[sudo]
>> password for twb:" is not matched by M-x shell's password regexp
>
> Thanks for the report, comint-password-prompt-regexp has been
> changed upstream after a Gutsy user reported this.  The fix will be
> in Emacs 22.2, here is how you can set
> comint-password-prompt-regexp:
>
> (setq comint-password-prompt-regexp
>       "\\(\\([Oo]ld \\|[Nn]ew \\|'s \\|login \\|\
> Kerberos \\|CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] \\|^\\)\
> \[Pp]assword\\( (again)\\)?\\|\
> pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\
> \\(?:, try again\\)?\\(?: for [^:]+\\)?:\\s *\\'")

Thank you.  Because I am an rx fan, I took a moment to translate this
to rx (hopefully correctly).  I include it below for the benefit of
others trawling the BTS.  The predicate attempts to apply the patch to
only those versions for which this has not been fixed upstream.

(when (or (< emacs-major-version 22)
          (and (= emacs-major-version 22)
               (< emacs-minor-version 2)))
  (setq comint-password-prompt-regexp
        (or "\\(?:\\(?:\\(?:\\(?:Old\\|old\\|New\\|new\\|'s \\|login 
\\|Kerberos \\|CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] 
\\|^\\)\\(?:[Pp]assword\\)\\(?: (again)\\)?\\)\\|pass 
phrase\\|\\(?:\\(?:\\(?:Bad\\|Enter\\|Repeat\\) 
\\)?\\(?:[Pp]assphrase\\)\\)\\)\\(?:, try again\\)?\\(?: for 
[^:]+\\)?:\\(?:\\s-\\)*\\'\\)"
            ;; pre-compiled above to avoid requiring rx at boot
            (rx (| (: (| "Old" "old" "New" "new" "'s " "login "
                         "Kerberos " "CVS " "UNIX " " SMB "
                         "LDAP " "[sudo] " ; added
                         bol)
                      (| "Password" "password")
                      (? " (again)"))
                   "pass phrase"
                   ;; changed
                   (: (? (| "Enter" "Repeat" "Bad") " ")
                      (| "Passphrase" "passphrase")))
                (? ", try again")
                (? " for " (+ (not (any ":"))))
                ":"
                (* (syntax whitespace))
                eos))))

Attachment: signature.asc
Description: Digital signature

Reply via email to