GNU bug report logs - #43772
27.1; (describe-variable) breaks eshell

Previous Next

Package: emacs;

Reported by: daniel <at> codesections.com

Date: Sat, 3 Oct 2020 02:12:02 UTC

Severity: normal

Tags: confirmed, fixed

Found in version 27.1

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 43772 in the body.
You can then email your comments to 43772 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#43772; Package emacs. (Sat, 03 Oct 2020 02:12:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to daniel <at> codesections.com:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 03 Oct 2020 02:12:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: daniel <at> codesections.com
To: bug-gnu-emacs <at> gnu.org
Subject: 27.1; (describe-variable) breaks eshell
Date: Sat, 03 Oct 2020 02:11:43 +0000
When using eshell-mode, calling `(describe-variable)` on a variable that
starts with "eshell" causes eshell-watch-for-password-prompt to no
longer function correctly.  In the attached dribble file, I first show
the correct behavior by opening eshell and entering `sudo ls`; eshell
correctly prompts me for a password three times.  I then run
`(describe-variable 'eshell-after-prompt-hook)` and then enter `sudo
ls`.  This time, eshell displays the incorrect behavior: it prints the
string "password" but does not accept input as a password or print any
output from the command.  I selected `eshell-after-prompt-hook` becuase
it is one of the first variables starting with "eshell", but the same
behavior occurs with other variables, including user-defined ones.

The information below, generated with report-emacs-bug, is for my
laptop, where I observed the above bug on Emacs 27.1.  I also observed
the same bug on my desktop on Emacs 26.3 (build 2, x86_64-pc-linux-gnu),
so the issue isn't specific to the Void musl build.

I hope this information is helpful.  Thank you all for the wonderful
work you do on Emacs, and please let me know if I can provide any other
information.

Best regards,
Daniel 

In GNU Emacs 27.1 (build 1, x86_64-unknown-linux-musl)
 of 2020-08-12 built on vm1-a-mci-us
System Description: void

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list... [3 times]

Configured using:
 'configure --without-x --without-dbus --prefix=/usr --sysconfdir=/etc
 --sbindir=/usr/bin --bindir=/usr/bin --mandir=/usr/share/man
 --infodir=/usr/share/info --localstatedir=/var
 --with-file-notification=inotify --with-modules --with-jpeg --with-tiff
 --with-gif --with-png --with-xpm --with-rsvg --without-imagemagick
 --with-xml2 --with-gnutls --with-sound --with-m17n-flt --with-json
 --without-harfbuzz --without-cairo --with-libgmp
 --host=x86_64-unknown-linux-musl --build=x86_64-unknown-linux-musl
 'CFLAGS=-fno-PIE -mtune=generic -O2 -pipe -g' 'CPPFLAGS= '
 'LDFLAGS=-no-pie -Wl,--as-needed ''

Configured features:
SOUND NOTIFY INOTIFY ACL GNUTLS LIBXML2 ZLIB XIM MODULES THREADS JSON
PDUMPER LCMS2 GMP

Important settings:
  value of $LC_COLLATE: C
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow regexp-opt sort mail-extr emacsbug message rmc puny dired
dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache
epa derived epg epg-config gnus-util rmail tool-bar rmail-loaddefs
text-property-search seq mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils time-date subr-x cl-loaddefs
cl-lib term/xterm xterm byte-opt gv bytecomp byte-compile cconv tooltip
eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer
select mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame minibuffer cl-generic 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 charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote threads inotify lcms2 multi-tty make-network-process emacs)

Memory information:
((conses 16 46396 8814)
 (symbols 48 6012 1)
 (strings 32 15639 1721)
 (string-bytes 1 506946)
 (vectors 16 8020)
 (vector-slots 8 86910 7560)
 (floats 8 23 290)
 (intervals 56 209 0)
 (buffers 1000 12))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43772; Package emacs. (Mon, 05 Oct 2020 08:10:02 GMT) Full text and rfc822 format available.

Message #8 received at 43772 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: daniel <at> codesections.com
Cc: 43772 <at> debbugs.gnu.org
Subject: Re: bug#43772: 27.1; (describe-variable) breaks eshell
Date: Mon, 05 Oct 2020 10:09:14 +0200
daniel <at> codesections.com writes:

> When using eshell-mode, calling `(describe-variable)` on a variable that
> starts with "eshell" causes eshell-watch-for-password-prompt to no
> longer function correctly.  In the attached dribble file, I first show
> the correct behavior by opening eshell and entering `sudo ls`; eshell
> correctly prompts me for a password three times.  I then run
> `(describe-variable 'eshell-after-prompt-hook)` and then enter `sudo
> ls`.  This time, eshell displays the incorrect behavior: it prints the
> string "password" but does not accept input as a password or print any
> output from the command. 

There was no dribble file attached, but I was able to reproduce the bug
in Emacs 28, too.

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




Added tag(s) confirmed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 05 Oct 2020 08:10:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43772; Package emacs. (Wed, 07 Oct 2020 05:44:01 GMT) Full text and rfc822 format available.

Message #13 received at 43772 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: daniel <at> codesections.com
Cc: 43772 <at> debbugs.gnu.org
Subject: Re: bug#43772: 27.1; (describe-variable) breaks eshell
Date: Wed, 07 Oct 2020 07:43:35 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> There was no dribble file attached, but I was able to reproduce the bug
> in Emacs 28, too.

A simpler way to reproduce the bug is to say

(require 'em-tramp)

This is because that file defines eshell/su, and when that's defined,
the command is passed onto the shell directly without any parsing (and
therefore no prompting).

The logic is in

(defun eshell-invoke-directly (command)
...
	 (fboundp (intern-soft (concat "eshell/" name))))))

I'm not an eshell user, so I'm not sure what's up with that?

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43772; Package emacs. (Sun, 15 Nov 2020 14:14:02 GMT) Full text and rfc822 format available.

Message #16 received at 43772 <at> debbugs.gnu.org (full text, mbox):

From: Ruthra Kumar <ruthrab <at> gmail.com>
To: 43772 <at> debbugs.gnu.org
Subject: Fix for bug#43772
Date: Sun, 15 Nov 2020 19:43:14 +0530
[Message part 1 (text/plain, inline)]
Hello Lars,

As you've mentioned, parsing ( and prompting ) is not done, when
command is sent directly to shell. But, i think
'eshell-invoke-directly' should not have returned true for sudo and
su. Comment section in 'eshell-find-alias-function' best describes it,

(defun eshell-find-alias-function (name)
 ...
    ;; If the function exists, but is defined in an eshell module
    ;; that's not currently enabled, don't report it as found.

eshell-tramp is disabled by default. So, eshell-invoke-directly should
return nil for su and sudo ( I'm new to eshell as well. So, I might be
wrong here ). Replacing fboundp with 'eshell-find-alias-function'
should fix this. So far, I've tested locally and it is working fine.

Patch attached.

Regards
Ruthra Kumar
[0001-eshell-invoke-directly-use-eshell-find-alias-functio.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43772; Package emacs. (Mon, 16 Nov 2020 22:07:01 GMT) Full text and rfc822 format available.

Message #19 received at 43772 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Ruthra Kumar <ruthrab <at> gmail.com>
Cc: 43772 <at> debbugs.gnu.org
Subject: Re: bug#43772: Fix for bug#43772
Date: Mon, 16 Nov 2020 23:06:19 +0100
Ruthra Kumar <ruthrab <at> gmail.com> writes:

> eshell-tramp is disabled by default. So, eshell-invoke-directly should
> return nil for su and sudo ( I'm new to eshell as well. So, I might be
> wrong here ). Replacing fboundp with 'eshell-find-alias-function'
> should fix this. So far, I've tested locally and it is working fine.

Thanks; I tested it and it fixes the reported case, while apparently
having no other obvious negative effects, so I've applied it to Emacs
28.  (I'm not overly familiar with how eshell is supposed to work,
though...)

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




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 16 Nov 2020 22:07:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 43772 <at> debbugs.gnu.org and daniel <at> codesections.com Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 16 Nov 2020 22:07:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 15 Dec 2020 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 132 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.