[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#46609: Fix shell password prompt in minibuffer (bug 43302)
From: |
Andreas Schwab |
Subject: |
bug#46609: Fix shell password prompt in minibuffer (bug 43302) |
Date: |
Thu, 18 Feb 2021 12:50:47 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1.91 (gnu/linux) |
On Feb 18 2021, Lars Ingebrigtsen wrote:
> Ryan Prior <rprior@protonmail.com> writes:
>
>> The current comint-password-prompt-regexp does not tolerate newlines at
>> the end of the prompt, so a string like "Password:\n" will not be
>> recognized as a password prompt in shell-mode. Before Emacs 27
>> (74277b0e881) newlines were tolerated here, so this is a regression, and
>> as a result I would sometimes echo my password in plain text where
>> previously it would be hidden.
>
> Thanks; applied to Emacs 27 with one change:
>
>> + (when (string-match "[\n]+$" string)
>> + (setq string (replace-match "" t t string)))
>
> This should probably be "\n+\\'", because we only want to remove
> newlines from the end of the string, and not newlines from the middle of
> the string, presumably? ("$" means "match end of line", not "match end
> of string".)
The preceding line should probably use "\\`" as well.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."