all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Ryan Prior <rprior@protonmail.com>, 46609@debbugs.gnu.org
Subject: bug#46609: Fix shell password prompt in minibuffer (bug 43302)
Date: Thu, 18 Feb 2021 12:50:47 +0100	[thread overview]
Message-ID: <87czwxzjag.fsf@igel.home> (raw)
In-Reply-To: <8735xty50f.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 18 Feb 2021 12:44:32 +0100")

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





  reply	other threads:[~2021-02-18 11:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-18  1:13 bug#46609: Fix shell password prompt in minibuffer (bug 43302) Ryan Prior via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-02-18 11:44 ` Lars Ingebrigtsen
2021-02-18 11:50   ` Andreas Schwab [this message]
2021-02-18 11:56     ` Lars Ingebrigtsen
2021-02-18 14:42   ` Eli Zaretskii
2021-02-18 15:29     ` Lars Ingebrigtsen
2021-02-18 14:39 ` Eli Zaretskii
2021-02-18 14:47   ` Lars Ingebrigtsen
2021-02-18 15:01     ` Eli Zaretskii
2021-02-18 15:26       ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87czwxzjag.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=46609@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=rprior@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.