Subject: Re: bug#43003: 28.0.50; comint-password-prompt-regexp too restrictive

From: Stephen Berman <[email-masked]>
Date: Thu, 27 Aug 2020 17:09:03 +0200

On Thu, 27 Aug 2020 15:02:44 +0200 Lars Ingebrigtsen <[email-masked]> wrote:

> Stephen Berman <[email-masked]> writes:
>
>> The minimal change to fix my use case is to add the carriage return
>> character as an alternative to comint-password-prompt-regexp, as in the
>> attached patch.  If even that is too risky, I'll just stick with a local
>> fix.
>>
>> Steve
>>
>> diff --git a/lisp/comint.el b/lisp/comint.el
>> index 092902d865..b6098f449d 100644
>> --- a/lisp/comint.el
>> +++ b/lisp/comint.el
>> @@ -365,7 +365,7 @@ comint-process-echoes
>>  ;; See ert test `comint-test-password-regexp'.
>>  (defcustom comint-password-prompt-regexp
>>    (concat
>> -   "\\(^ *\\|"
>> +   "\\(^ *\\|"
>>     (regexp-opt
>>      '("Enter" "enter" "Enter same" "enter same" "Enter the" "enter the"
>>        "Enter Auth" "enter auth" "Old" "old" "New" "new" "'s" "login"
>
> I don't quite understand how this patch helps -- doesn't this just
> require a ^M character before Enter/Old/etc?  Did you mean
>
>> +   "\\(^ *\\|\\|"

(It looks like Gnus removed the ^M characters.)  Yes, I just tested
again and the password is indeed hidden only when `\\|' follows `^M' in
the regexp.  Apparently I omitted that when I made the diff for the
patch after testing yesterday...

Steve Berman