* bug#74626: 30.0.91; mini buffer password prompt mismatches shell buffer's
@ 2024-11-30 16:19 Van Ly via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-30 17:32 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-01 15:44 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 2 replies; 11+ messages in thread
From: Van Ly via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-11-30 16:19 UTC (permalink / raw)
To: 74626
[-- Attachment #1: Type: text/plain, Size: 720 bytes --]
Hello,
When using ssh to connect to a machine, the password prompt is expected
to be identical in the shell buffer and mini buffer.
The mini buffer's prompt seems to make use of only the last character.
See
http://sdf.org/~van.ly/img/emacs-30-0-91-password-prompt.webp
The shell buffer's password prompt shows
van@192.168.1.144's password:
The mini buffer shows
4's password:
Further attempts to backout using C-g and RET may show on the mini buffer
44's password:
To demonstrate,
0. start, emacs -Q
1. use, M-x shell
2. use, ssh to connect to machine (ssh is unconfigured)
X. expect the mini buffer password prompt to be more meaningfully
related to the actual prompt in the shell buffer
[-- Attachment #2: bug report diagnostics --]
[-- Type: application/octet-stream, Size: 2923 bytes --]
From: xxx <xxx@xxx.mail-host-address-is-not-set>
To: bug-gnu-emacs@gnu.org
Subject: 30.0.91; x
X-Debbugs-Cc:
--text follows this line--
In GNU Emacs 30.0.91 (build 1, aarch64--linux-gnu) of 2024-10-21 built
on xxx
System Description: Debian GNU/Linux 12 (bookworm)
Configured using:
'configure --without-all --without-x --without-ns
--without-compress-install --without-toolkit-scroll-bars
--srcdir=/u/24/src/emacs/30.0.91 --prefix=/usr/local
--build=aarch64--linux-gnu --host=aarch64--linux-gnu CFLAGS=-O2'
Configured features:
GMP PDUMPER SECCOMP XIM
Important settings:
value of $LANG: en_AU.UTF-8
locale-coding-system: utf-8-unix
Major mode: Shell
Minor modes in effect:
shell-dirtrack-mode: t
comint-fontify-input-mode: t
tooltip-mode: t
global-eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
minibuffer-regexp-mode: t
line-number-mode: t
indent-tabs-mode: t
transient-mark-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
Load-path shadows:
None found.
Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dnd dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config
gnus-util text-property-search time-date mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils cl-extra help-mode
tool-bar auth-source cl-seq eieio eieio-core cl-macs icons
password-cache json map wombat-theme sh-script rx smie treesit
cl-loaddefs cl-lib executable files-x shell pcomplete comint subr-x
regexp-opt ansi-osc ansi-color ring term/xterm xterm byte-opt gv
bytecomp byte-compile rmc iso-transl tooltip cconv eldoc paren electric
uniquify ediff-hook vc-hooks lisp-float-type elisp-mode tabulated-list
replace newcomment text-mode lisp-mode prog-mode register page tab-bar
menu-bar rfn-eshadow isearch easymenu timer select mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq
simple cl-generic indonesian philippine cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button
loaddefs theme-loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget keymap hashtable-print-readable backquote multi-tty
make-network-process emacs)
Memory information:
((conses 16 73358 10048) (symbols 48 8312 0) (strings 32 22778 1526)
(string-bytes 1 563844) (vectors 16 12134)
(vector-slots 8 115188 5661) (floats 8 34 12870)
(intervals 56 273 20) (buffers 984 13))
[-- Attachment #3: Type: text/plain, Size: 9 bytes --]
--
vl
^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#74626: 30.0.91; mini buffer password prompt mismatches shell buffer's
2024-11-30 16:19 bug#74626: 30.0.91; mini buffer password prompt mismatches shell buffer's Van Ly via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-11-30 17:32 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-30 19:29 ` Van Ly via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-01 15:48 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-01 15:44 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
1 sibling, 2 replies; 11+ messages in thread
From: Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-11-30 17:32 UTC (permalink / raw)
To: 74626; +Cc: van.ly
Van Ly via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs@gnu.org> writes:
> Hello,
>
> When using ssh to connect to a machine, the password prompt is expected
> to be identical in the shell buffer and mini buffer.
>
> The mini buffer's prompt seems to make use of only the last character.
>
> See
>
> http://sdf.org/~van.ly/img/emacs-30-0-91-password-prompt.webp
>
> The shell buffer's password prompt shows
>
> van@192.168.1.144's password:
>
> The mini buffer shows
>
> 4's password:
I can confirm this bug. I did not report it but I've seen this only
when the host is just an IP address.
--
Manuel Giraud
^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#74626: 30.0.91; mini buffer password prompt mismatches shell buffer's
2024-11-30 17:32 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-11-30 19:29 ` Van Ly via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-01 15:48 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
1 sibling, 0 replies; 11+ messages in thread
From: Van Ly via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-11-30 19:29 UTC (permalink / raw)
To: Manuel Giraud; +Cc: 74626
>>
>> The mini buffer shows
>>
>> 4's password:
Also, the color scheme for the theme `modus-vivendi-tinted' represents
that "4" with an unreadable foreground/background color combination to
my eyes anyway. It looked gray on gray IIRC.
--
vl
^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#74626: 30.0.91; mini buffer password prompt mismatches shell buffer's
2024-11-30 17:32 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-30 19:29 ` Van Ly via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-12-01 15:48 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-01 16:42 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
1 sibling, 1 reply; 11+ messages in thread
From: Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-12-01 15:48 UTC (permalink / raw)
To: 74626; +Cc: van.ly, manuel
Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@gnu.org> writes:
Hi Manuel,
>> The shell buffer's password prompt shows
>>
>> van@192.168.1.144's password:
>>
>> The mini buffer shows
>>
>> 4's password:
>
> I can confirm this bug. I did not report it but I've seen this only
> when the host is just an IP address.
For me, it happens also for using a hostname, like "ssh localhost".
Best regards, Michael.
^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#74626: 30.0.91; mini buffer password prompt mismatches shell buffer's
2024-12-01 15:48 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-12-01 16:42 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 0 replies; 11+ messages in thread
From: Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-12-01 16:42 UTC (permalink / raw)
To: Michael Albinus; +Cc: van.ly, 74626
Michael Albinus <michael.albinus@gmx.de> writes:
> Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of
> text editors" <bug-gnu-emacs@gnu.org> writes:
>
> Hi Manuel,
>
>>> The shell buffer's password prompt shows
>>>
>>> van@192.168.1.144's password:
>>>
>>> The mini buffer shows
>>>
>>> 4's password:
>>
>> I can confirm this bug. I did not report it but I've seen this only
>> when the host is just an IP address.
>
> For me, it happens also for using a hostname, like "ssh localhost".
Hi Michael,
You're right, my bad. It also shows with hostnames it is just that most
of the time I have authorized_keys in place in such case.
--
Manuel Giraud
^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#74626: 30.0.91; mini buffer password prompt mismatches shell buffer's
2024-11-30 16:19 bug#74626: 30.0.91; mini buffer password prompt mismatches shell buffer's Van Ly via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-30 17:32 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-12-01 15:44 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-01 16:43 ` Van Ly via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-01 19:54 ` Jim Porter
1 sibling, 2 replies; 11+ messages in thread
From: Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-12-01 15:44 UTC (permalink / raw)
To: 74626; +Cc: van.ly, jporterbugs
[-- Attachment #1: Type: text/plain, Size: 1443 bytes --]
Van Ly via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs@gnu.org> writes:
> Hello,
Hi,
> When using ssh to connect to a machine, the password prompt is expected
> to be identical in the shell buffer and mini buffer.
>
> The mini buffer's prompt seems to make use of only the last character.
>
> See
>
> http://sdf.org/~van.ly/img/emacs-30-0-91-password-prompt.webp
>
> The shell buffer's password prompt shows
>
> van@192.168.1.144's password:
>
> The mini buffer shows
>
> 4's password:
Thanks for the report.
I can reproduce the problem. In fact, there are two issues:
- comint-password-prompt-regexp uses "'s" in order to search for a password
prompt. That's fine for password prompts like "van@192.168.1.144's
password:", however, everything before this "'s" is ignored when the
minibuffer prompt is assembled.
- The string the password prompt is looked for is "van@192.168.1.144's
password:". In comint-watch-for-password-prompt, the "" is removed,
but while searching for the password prompt. As a result,
(match-string 0 string) returns a wrong substring (just one position
left).
The problem does not happen with Emacs 29. The culprit seems to be
commit 1a55e957ae57, which has changed the implementation of
comint-watch-for-password-prompt. The appended patch fixes this for me
in Emacs 30. Could you, please, check?
Jim, do you have a comment?
Best regards, Michael.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1983 bytes --]
diff --git a/lisp/comint.el b/lisp/comint.el
index 8860b3edb11..8b4ab2f9ea1 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -404,7 +404,7 @@ comint-password-prompt-regexp
(regexp-opt
'("Enter" "enter" "Enter same" "enter same" "Enter the" "enter the"
"Current"
- "Enter Auth" "enter auth" "Old" "old" "New" "new" "'s" "login"
+ "Enter Auth" "enter auth" "Old" "old" "New" "new" "login"
"Kerberos" "CVS" "UNIX" " SMB" "LDAP" "PEM" "SUDO"
"[sudo]" "doas" "Repeat" "Bad" "Retype" "Verify")
t)
@@ -418,11 +418,13 @@ comint-password-prompt-regexp
;; The ccrypt encryption dialog doesn't end with a colon, so
;; treat it specially.
"\\|^Enter encryption key: (repeat) *\\'"
+ ;; Default openssh format: "user@host's password:".
+ "\\|^[^@ \t\n]+@[^@ \t\n]+'s password: *\\'"
;; openssh-8.6p1 format: "(user@host) Password:".
"\\|^([^)@ \t\n]+@[^)@ \t\n]+) Password: *\\'")
"Regexp matching prompts for passwords in the inferior process.
This is used by `comint-watch-for-password-prompt'."
- :version "29.1"
+ :version "30.1"
:type 'regexp
:group 'comint)
@@ -2568,11 +2570,12 @@ comint-watch-for-password-prompt
carriage returns (\\r) in STRING.
This function could be in the list `comint-output-filter-functions'."
- (let ((string (string-limit string comint-password-prompt-max-length t))
+ (let ((string (string-limit
+ (string-replace "\r" "" string)
+ comint-password-prompt-max-length t))
prompt)
(when (let ((case-fold-search t))
- (string-match comint-password-prompt-regexp
- (string-replace "\r" "" string)))
+ (string-match comint-password-prompt-regexp string))
(setq prompt (string-trim (match-string 0 string)
"[ \n\r\t\v\f\b\a]+" "\n+"))
;; Use `run-at-time' in order not to pause execution of the
^ permalink raw reply related [flat|nested] 11+ messages in thread
* bug#74626: 30.0.91; mini buffer password prompt mismatches shell buffer's
2024-12-01 15:44 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-12-01 16:43 ` Van Ly via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-01 17:40 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-01 18:09 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-01 19:54 ` Jim Porter
1 sibling, 2 replies; 11+ messages in thread
From: Van Ly via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-12-01 16:43 UTC (permalink / raw)
To: Michael Albinus; +Cc: jporterbugs, 74626
Michael Albinus <michael.albinus@gmx.de> writes:
The appended patch fixes this for me
> in Emacs 30. Could you, please, check?
The patch fixes the mismatch. Thank you.
--
vl
^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#74626: 30.0.91; mini buffer password prompt mismatches shell buffer's
2024-12-01 16:43 ` Van Ly via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-12-01 17:40 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-01 18:09 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
1 sibling, 0 replies; 11+ messages in thread
From: Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-12-01 17:40 UTC (permalink / raw)
To: Van Ly; +Cc: jporterbugs, 74626
Van Ly <van.ly@SDF.ORG> writes:
Hi,
> The appended patch fixes this for me
>> in Emacs 30. Could you, please, check?
>
> The patch fixes the mismatch. Thank you.
Thanks for the feedback. However, I'd like to hear also from Jim. I'm
not sure whether my change of comint-password-prompt-regexp is proper,
we could lose localized password-word-equivalents in that case.
OTOH, ISTM that the ssh password prompt cannot be localized. And there's
also the openssh-8.6p1 format in that regexp, which doesn't use a
localized prompt either.
Best regards, Michael.
^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#74626: 30.0.91; mini buffer password prompt mismatches shell buffer's
2024-12-01 16:43 ` Van Ly via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-01 17:40 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-12-01 18:09 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
1 sibling, 0 replies; 11+ messages in thread
From: Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-12-01 18:09 UTC (permalink / raw)
To: 74626; +Cc: van.ly, michael.albinus, jporterbugs
Van Ly via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs@gnu.org> writes:
> Michael Albinus <michael.albinus@gmx.de> writes:
>
> The appended patch fixes this for me
>> in Emacs 30. Could you, please, check?
>
> The patch fixes the mismatch. Thank you.
FWIW, also fixes the issue for me. Thanks.
--
Manuel Giraud
^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#74626: 30.0.91; mini buffer password prompt mismatches shell buffer's
2024-12-01 15:44 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-01 16:43 ` Van Ly via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-12-01 19:54 ` Jim Porter
2024-12-02 18:30 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
1 sibling, 1 reply; 11+ messages in thread
From: Jim Porter @ 2024-12-01 19:54 UTC (permalink / raw)
To: Michael Albinus, 74626; +Cc: van.ly
On 12/1/2024 7:44 AM, Michael Albinus via Bug reports for GNU Emacs, the
Swiss army knife of text editors wrote:
> - comint-password-prompt-regexp uses "'s" in order to search for a password
> prompt. That's fine for password prompts like "van@192.168.1.144's
> password:", however, everything before this "'s" is ignored when the
> minibuffer prompt is assembled.
>
[snip]
>
> The problem does not happen with Emacs 29. The culprit seems to be
> commit 1a55e957ae57, which has changed the implementation of
> comint-watch-for-password-prompt. The appended patch fixes this for me
> in Emacs 30. Could you, please, check?
>
> Jim, do you have a comment?
My goal with the previous change (aside from the
'comint-password-prompt-max-length' stuff) was just to make sure that we
don't show extraneous lines in the minibuffer that aren't part of the
prompt. For example, consider a script like this:
#!/bin/sh
cat some-large-file.txt
echo "Enter password: "
read PASSWORD
# ...
The minibuffer would show (some of) the output of "some-large-file.txt".
My hope was to use the matched result from
'comint-password-prompt-regexp' to do this, though apparently sometimes
that regexp doesn't match the *whole* password prompt (e.g. in the "'s"
case you identified). For Emacs 30, maybe the simplest fix is something
like so? That should restore the old behavior, warts and all:
----------------------------------------
diff --git a/lisp/comint.el b/lisp/comint.el
index 4268fa8dad2..a6b078b685b 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -2574,8 +2574,7 @@ comint-watch-for-password-prompt
(when (let ((case-fold-search t))
(string-match comint-password-prompt-regexp
(string-replace "\r" "" string)))
- (setq prompt (string-trim (match-string 0 string)
- "[ \n\r\t\v\f\b\a]+" "\n+"))
+ (setq prompt (string-trim string "[ \n\r\t\v\f\b\a]+" "\n+"))
;; Use `run-at-time' in order not to pause execution of the
;; process filter with a minibuffer
(run-at-time
----------------------------------------
For the master branch, I think your patch makes sense, assuming we're
confident that 'comint-password-prompt-regexp' now matches the entire
prompt in all (most?) cases.
^ permalink raw reply related [flat|nested] 11+ messages in thread
* bug#74626: 30.0.91; mini buffer password prompt mismatches shell buffer's
2024-12-01 19:54 ` Jim Porter
@ 2024-12-02 18:30 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 0 replies; 11+ messages in thread
From: Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-12-02 18:30 UTC (permalink / raw)
To: Jim Porter; +Cc: van.ly, 74626-done
Jim Porter <jporterbugs@gmail.com> writes:
Hi Jim,
> For Emacs 30, maybe the simplest fix is something
> like so? That should restore the old behavior, warts and all:
>
> For the master branch, I think your patch makes sense, assuming we're
> confident that 'comint-password-prompt-regexp' now matches the entire
> prompt in all (most?) cases.
Done as proposed. Closing the bug.
Best regards, Michael.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2024-12-02 18:30 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-30 16:19 bug#74626: 30.0.91; mini buffer password prompt mismatches shell buffer's Van Ly via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-30 17:32 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-30 19:29 ` Van Ly via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-01 15:48 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-01 16:42 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-01 15:44 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-01 16:43 ` Van Ly via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-01 17:40 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-01 18:09 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-01 19:54 ` Jim Porter
2024-12-02 18:30 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).