bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#46609: Fix shell password prompt in minibuffer (bug 43302)


From: Lars Ingebrigtsen
Subject: bug#46609: Fix shell password prompt in minibuffer (bug 43302)
Date: Thu, 18 Feb 2021 12:44:32 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

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".)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

[Prev in Thread] Current Thread [Next in Thread]